<@U02BE6ANKS7> Have you tried this? go to your tab...
# integrate-tableau-datahub
q
@handsome-belgium-11927 Have you tried this? go to your tableau graphql page
your-tableau-url/metadata/graphiql
and run this. There are a few examples here that you can use. You can then map the o/p to DataHub’s chart or dashboard schema. We’re trying to add some automation around this process. I’ll be happy to share when we have something tangible. But the below query should get you started with ownership and datasources.
Copy code
query ShowMeWorkbookEmbeddedFilters {
  workbooks(filter: { name: "your-workbook-name" }) {
    name
    owner {
      id
      name
    }
    embeddedDatasources {
      name
      upstreamTables {
        id
        name
      }
      upstreamDatabases {
        id
        name
      }
    }
  }
}
👀 1
h
Copy code
Can't run the query because the Metadata API has not been enabled yet
I'll ask our admins if they can turn it on
Ok, it is working and looks great. Gonna test it today, many thanks!
q
np
h
@quiet-kilobyte-82304, did you manage to get code from Custom SQL Queries via GraphQL? I'm getting it like this:
Copy code
"embeddedDatasources": [
          {
            "name": "Custom SQL Query",
            "upstreamTables": [],
            "upstreamDatabases": []
          }
        ]
and I can't any fields for embedded datasources that look like sql code
q
are you referring to initial sql?
h
I guess so, I don't know if there is some other sql
In xml it looks like this:
Copy code
<_.fcp.ObjectModelEncapsulateLegacy.false...relation connection='exasolution.1iv62f01yftgxg10kul6q0tx71tg' name='Custom_SQL_Query' type='text'><![CDATA[with rfm as
	(
		select	"DATE"
			,LOCALITY_ID
			,DRIVER_ID
			,SEGMENT_ID
		from 
...
q
the result you got above is because the workbook that you’re getting the metadata for doesn’t use custom sql
I did verify with one of our workbooks
m
@quiet-kilobyte-82304: would this stuff generalize to become a regular open-source connector?
q
Perhaps. Currently we’re building this with a lot of organizational context, because our tableau workbooks don’t follow a specific standard (they could be any of these types “custom sql”, drag and drop, embedded datasource, standalone datasource). This can be generically written you just want to achieve the bare minimum i.e., owner, datasources. Current development cycle includes a) getting the list of workbooks and extracts, b) grabbing metadata and c) converting this to a chart or dashboard ingestible mce. Long term I don’t want this to be batchy, but push the metadata whenever a new tableau workbook or version of the workbook is published. I’ll have a better answer for you in 3 weeks when we finish out MVP using datahub🙂 We’re trying to touch all the analytics services that our platform currently supports. (doing depth rather than breadth)
h
Copy code
the result you got above is because the workbook that you're getting the metadata for doesn't use custom sql
well, BI engineer showed me that this particular datasource is using some custom sql, I may be wrong with terms, but I want to get this code somehow, and graphql not giving me anything like that
q
can you edit the workbook and check if there really a custom SQL under
data sources -> initial SQL
?
h
I can't check it until monday 😞 Though I think that is exactly what engineer showed me