-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
Something like this will get you close @bmofkn I added comments to the SQL query because TS autogens the aliases. SELECT
"ta_1"."NAME" "ca_1", // UpstreamTableOrView
"ta_2"."COLUMN_NAME" "ca_2", // UpstreamTableOrViewColumn
"ta_3"."NAME" "ca_3" // Worksheet
FROM "GTM_DB"."CS_TOOLS_V150"."TS_DEPENDENT_OBJECT" "ta_3"
INNER JOIN "GTM_DB"."CS_TOOLS_V150"."TS_METADATA_COLUMN" "ta_2"
ON (
"ta_3"."COLUMN_GUID" = "ta_2"."COLUMN_GUID"
AND "ta_3"."CLUSTER_GUID" = "ta_2"."CLUSTER_GUID"
)
RIGHT OUTER JOIN "GTM_DB"."CS_TOOLS_V150"."TS_METADATA_OBJECT" "ta_1"
ON (
"ta_2"."CLUSTER_GUID" = "ta_1"."CLUSTER_GUID"
AND "ta_2"."OBJECT_GUID" = "ta_1"."OBJECT_GUID"
)
WHERE (
LOWER("ta_3"."OBJECT_TYPE") = 'logical_table' // ta_3 = TS_DEPENDENT_OBJECT
AND LOWER("ta_3"."OBJECT_SUBTYPE") = 'worksheet' // ta_3 = TS_DEPENDENT_OBJECT
AND LOWER("ta_3"."NAME") = 'cs tools - worksheet column utilization' // ta_3 = TS_DEPENDENT_OBJECT
AND "ta_2"."HIDDEN" = FALSE // ta_3 = TS_METADATA_COLUMN
)
GROUP BY
"ca_1",
"ca_2",
"ca_3"
ORDER BY "ca_1" ASC NULLS LASTThe object hierarchy in the model looks like this |
Beta Was this translation helpful? Give feedback.
-
|
Aside: what exactly are you trying to do here? 😄 |
Beta Was this translation helpful? Give feedback.


This makes sense @bmofkn ! The data model (really, the ThoughtSpot Dependency APIs) does not show direct lineage, instead shows "for a given column, what is the downstream lineage?" so your example would be..
object JOIN column LEFT JOIN dependentsDependents table would list the Worksheet, then also Answer/Liveboards that are used by that column as well.
The reason why we don't show direct lineage..
is because an object graph may be simple, but it also may be arbitrarily complex.