Open chriiisiscoding opened 2 months ago
Internal tracking ID: 16646216
A couple of quick things to check:
The relevant JDBC metadata queries are listed here: https://tableau.github.io/connector-plugin-sdk/docs/metadata-enumeration#jdbc-metadata-enumeration
Full list of all capabilities is here: https://tableau.github.io/connector-plugin-sdk/docs/capabilities. Given the errors in the log, you may want to double check the CAP_SELECT_INTO capability should be set to yes for you.
More documentation on setting capabilities: https://tableau.github.io/connector-plugin-sdk/docs/design#set-connector-capabilities
If you're still running into issues, we'll take a look, but this looks like a specific issue with connecting to your data source that we don't have insight into.
Those are our temp table probe queries. We use temp tables for optimizations, but they usually aren't required except in some very large queries. It's probably a red herring (definitely not the first time).
Tableau needs to understand if your database should list catalogs (databases) or schemas only. You have specified dbname in the URL. In cases like that it's common (but not always) that you would disable catalog queries and only list schemas. That's probably what you need to do.
Thank you for your quick response! I set the following customizations based on the linked documentation:
<customizations>
<customization name="CAP_SELECT_INTO" value="yes"/>
<customization name="CAP_JDBC_SUPPRESS_EMPTY_CATALOG_NAME" value="yes"/>
<customization name="CAP_JDBC_METADATA_SUPPRESS_PREPARED_QUERY" value="yes"/>
<customization name="CAP_JDBC_METADATA_USE_RESULTSET_FOR_TABLE " value="yes"/>
<customization name="CAP_JDBC_METADATA_READ_FOREIGNKEYS" value="no"/>
<customization name="CAP_JDBC_METADATA_READ_PRIMARYKEYS" value="no"/>
<customization name="CAP_JDBC_METADATA_GET_INDEX_INFO" value="no"/>
</customizations>
But I'm still getting the following errors:
2024-09-03 16:15:08.914 -0700 (,,,,,14) grpc-default-executor-0 : INFO com.tableausoftware.util.LogHelpers - Running query 4036351974
2024-09-03 16:15:08.924 -0700 (,,,,,14) grpc-default-executor-0 : INFO com.tableausoftware.util.LogHelpers - Qurantine {00000000-0000-0000-0000-000000000000}. Running query
SELECT *
INTO "#Tableau_1_F9133AE7-BE9D-46D1-937D-379B28DC9578_1_Connect_CheckSelectIntoCap"
FROM (SELECT 1 AS COL) AS CHECKTEMP
2024-09-03 16:15:08.945 -0700 (,,,,,14) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - End local request 14 /runQuery.
2024-09-03 16:15:09.085 -0700 (,,,,,14) pool-3-thread-1 : ERROR com.tableausoftware.jdbc.JDBCProtocolImpl - Exception DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=);ROM (SELECT 1 AS COL;<table_expr>, DRIVER=4.33.31 for query:
SELECT *
INTO "#Tableau_1_F9133AE7-BE9D-46D1-937D-379B28DC9578_1_Connect_CheckSelectIntoCap"
FROM (SELECT 1 AS COL) AS CHECKTEMP
2024-09-03 16:15:09.085 -0700 (,,,,,14) pool-3-thread-1 : ERROR com.tableau.connect.service.QueryTask - Query for protocol 0 exiting with error class com.ibm.db2.jcc.am.SqlSyntaxErrorException
2024-09-03 16:15:09.085 -0700 (,,,,,15) grpc-default-executor-0 : ERROR com.tableau.connect.grpc.GrpcProtocolService - Failed in fetchResults. SQLState=42601, ErrorCode=-104.
com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=);ROM (SELECT 1 AS COL;<table_expr>, DRIVER=4.33.31
at com.ibm.db2.jcc.am.b4.a(b4.java:810) ~[?:?]
at com.ibm.db2.jcc.am.b4.a(b4.java:66) ~[?:?]
at com.ibm.db2.jcc.am.b4.a(b4.java:140) ~[?:?]
at com.ibm.db2.jcc.am.kn.c(kn.java:2868) ~[?:?]
at com.ibm.db2.jcc.am.kn.d(kn.java:2852) ~[?:?]
at com.ibm.db2.jcc.am.kn.a(kn.java:2278) ~[?:?]
at com.ibm.db2.jcc.t4.aa.i(aa.java:202) ~[?:?]
at com.ibm.db2.jcc.t4.aa.b(aa.java:92) ~[?:?]
at com.ibm.db2.jcc.t4.p.a(p.java:32) ~[?:?]
at com.ibm.db2.jcc.t4.au.i(au.java:150) ~[?:?]
at com.ibm.db2.jcc.am.kn.al(kn.java:2247) ~[?:?]
at com.ibm.db2.jcc.am.kn.a(kn.java:3376) ~[?:?]
at com.ibm.db2.jcc.am.kn.e(kn.java:1138) ~[?:?]
at com.ibm.db2.jcc.am.kn.execute(kn.java:1117) ~[?:?]
at com.tableausoftware.jdbc.JDBCProtocolImpl.runQuery(JDBCProtocolImpl.java:613) ~[jdbcserver.jar:20242.0.2]
at com.tableausoftware.jdbc.JDBCProtocolImpl.runQuery(JDBCProtocolImpl.java:674) ~[jdbcserver.jar:20242.0.2]
at com.tableau.connect.service.QueryTask.readData(QueryTask.java:132) ~[jdbcserver.jar:20242.0.2]
at com.tableau.connect.service.QueryTask.call(QueryTask.java:99) ~[jdbcserver.jar:20242.0.2]
at com.tableau.connect.service.QueryTask.call(QueryTask.java:46) ~[jdbcserver.jar:20242.0.2]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
2024-09-03 16:15:09.246 -0700 (,,,,,16) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - Start local request 16 /isConnected.
2024-09-03 16:15:09.326 -0700 (,,,,,16) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - End local request 16 /isConnected.
2024-09-03 16:15:09.358 -0700 (,,,,,17) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - Start local request 17 /closeQuery.
2024-09-03 16:15:09.374 -0700 (,,,,,17) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - End local request 17 /closeQuery.
2024-09-03 16:15:09.407 -0700 (,,,,,18) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - Start local request 18 /runQuery.
2024-09-03 16:15:09.407 -0700 (,,,,,18) grpc-default-executor-0 : INFO com.tableausoftware.util.LogHelpers - Running query 1864843957
2024-09-03 16:15:09.407 -0700 (,,,,,18) grpc-default-executor-0 : INFO com.tableausoftware.util.LogHelpers - Qurantine {00000000-0000-0000-0000-000000000000}. Running query
DROP TABLE "#Tableau_1_F9133AE7-BE9D-46D1-937D-379B28DC9578_1_Connect_CheckSelectIntoCap"
2024-09-03 16:15:09.407 -0700 (,,,,,18) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - End local request 18 /runQuery.
2024-09-03 16:15:10.008 -0700 (,,,,,18) pool-3-thread-1 : ERROR com.tableausoftware.jdbc.JDBCProtocolImpl - Exception DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=JDOE.#Tableau_1_F9133AE7-BE9D-46D1-937D-379B28DC9578_1_Connect_, DRIVER=4.33.31 for query:
DROP TABLE "#Tableau_1_F9133AE7-BE9D-46D1-937D-379B28DC9578_1_Connect_CheckSelectIntoCap"
2024-09-03 16:15:10.008 -0700 (,,,,,18) pool-3-thread-1 : ERROR com.tableau.connect.service.QueryTask - Query for protocol 0 exiting with error class com.ibm.db2.jcc.am.SqlSyntaxErrorException
2024-09-03 16:15:10.008 -0700 (,,,,,19) grpc-default-executor-0 : ERROR com.tableau.connect.grpc.GrpcProtocolService - Failed in fetchResults. SQLState=42704, ErrorCode=-204.
com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=JDOE.#Tableau_1_F9133AE7-BE9D-46D1-937D-379B28DC9578_1_Connect_, DRIVER=4.33.31
at com.ibm.db2.jcc.am.b4.a(b4.java:810) ~[?:?]
at com.ibm.db2.jcc.am.b4.a(b4.java:66) ~[?:?]
at com.ibm.db2.jcc.am.b4.a(b4.java:140) ~[?:?]
at com.ibm.db2.jcc.am.kn.c(kn.java:2868) ~[?:?]
at com.ibm.db2.jcc.am.kn.d(kn.java:2852) ~[?:?]
at com.ibm.db2.jcc.am.kn.b(kn.java:2212) ~[?:?]
at com.ibm.db2.jcc.t4.aa.k(aa.java:442) ~[?:?]
at com.ibm.db2.jcc.t4.aa.c(aa.java:100) ~[?:?]
at com.ibm.db2.jcc.t4.p.b(p.java:38) ~[?:?]
at com.ibm.db2.jcc.t4.au.h(au.java:124) ~[?:?]
at com.ibm.db2.jcc.am.kn.ak(kn.java:2207) ~[?:?]
at com.ibm.db2.jcc.am.kn.a(kn.java:3412) ~[?:?]
at com.ibm.db2.jcc.am.kn.e(kn.java:1138) ~[?:?]
at com.ibm.db2.jcc.am.kn.execute(kn.java:1117) ~[?:?]
at com.tableausoftware.jdbc.JDBCProtocolImpl.runQuery(JDBCProtocolImpl.java:613) ~[jdbcserver.jar:20242.0.2]
at com.tableausoftware.jdbc.JDBCProtocolImpl.runQuery(JDBCProtocolImpl.java:674) ~[jdbcserver.jar:20242.0.2]
at com.tableau.connect.service.QueryTask.readData(QueryTask.java:132) ~[jdbcserver.jar:20242.0.2]
at com.tableau.connect.service.QueryTask.call(QueryTask.java:99) ~[jdbcserver.jar:20242.0.2]
at com.tableau.connect.service.QueryTask.call(QueryTask.java:46) ~[jdbcserver.jar:20242.0.2]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
at java.lang.Thread.run(Unknown Source) ~[?:?]
2024-09-03 16:15:10.018 -0700 (,,,,,20) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - Start local request 20 /isConnected.
2024-09-03 16:15:10.082 -0700 (,,,,,20) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - End local request 20 /isConnected.
2024-09-03 16:15:10.102 -0700 (,,,,,21) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - Start local request 21 /closeQuery.
2024-09-03 16:15:10.102 -0700 (,,,,,21) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - End local request 21 /closeQuery.
2024-09-03 16:15:14.881 -0700 (,,,,,22) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - Start local request 22 /enumerateNames.
2024-09-03 16:15:15.711 -0700 (,,,,,22) grpc-default-executor-0 : INFO com.tableausoftware.data.ProtobufJDBCResultSet - BindingInfo{columnName='TABLE_CATALOG', columnTypeName='VARCHAR', columnLabel='TABLE_CATALOG', columnType=12, precision=128, scale=0, columnDisplaySize=128, protobufType=STRING, nullable=noNulls}
2024-09-03 16:15:15.712 -0700 (,,,,,22) grpc-default-executor-0 : INFO com.tableausoftware.data.ProtobufJDBCResultSet - BindingInfo{columnName='TABLE_SCHEM', columnTypeName='VARCHAR', columnLabel='TABLE_SCHEM', columnType=12, precision=128, scale=0, columnDisplaySize=128, protobufType=STRING, nullable=noNulls}
2024-09-03 16:15:15.877 -0700 (,,,,,22) grpc-default-executor-0 : INFO com.tableau.connect.grpc.GrpcProtocolService - End local request 22 /enumerateNames.
CAP_SELECT_INTO
. But it looks like that is causing an error in the logs. Should I turn that off?Again, thank you for all your help!
If I set CAP_SELECT_INTO
to no
, the syntax error disappears but I still don't see any schemas:
2024-09-03 17:02:11.578 -0700 (,,,,,14) grpc-default-executor-1 : INFO com.tableau.connect.grpc.GrpcProtocolService - Start local request 14 /enumerateNames.
2024-09-03 17:02:11.832 -0700 (,,,,,14) grpc-default-executor-1 : INFO com.tableausoftware.data.ProtobufJDBCResultSet - BindingInfo{columnName='TABLE_CATALOG', columnTypeName='VARCHAR', columnLabel='TABLE_CATALOG', columnType=12, precision=128, scale=0, columnDisplaySize=128, protobufType=STRING, nullable=noNulls}
2024-09-03 17:02:11.833 -0700 (,,,,,14) grpc-default-executor-1 : INFO com.tableausoftware.data.ProtobufJDBCResultSet - BindingInfo{columnName='TABLE_SCHEM', columnTypeName='VARCHAR', columnLabel='TABLE_SCHEM', columnType=12, precision=128, scale=0, columnDisplaySize=128, protobufType=STRING, nullable=noNulls}
2024-09-03 17:02:11.947 -0700 (,,,,,14) grpc-default-executor-1 : INFO com.tableau.connect.grpc.GrpcProtocolService - End local request 14 /enumerateNames
Screenshot of missing schema:
Also, when I try to open a worksheet, I see a red exclamation mark next to the database name and an error when hovering over it:
I hope that helps.
Just a quick update, I entered a simple SELECT
Initial SQL query:
SELECT column FROM schema."table_name"
and saw this in the logs:
{00000000-0000-0000-0000-000000000000}. Running query
SELECT column FROM schema."table_name"
2024-09-04 05:39:44.938 -0700 (,,,,1,32) grpc-default-executor-3 : INFO com.tableau.connect.grpc.GrpcProtocolService - End local request 32 /runQuery.
2024-09-04 05:39:47.412 -0700 (,,,,1,32) pool-3-thread-2 : INFO com.tableausoftware.jdbc.FetchSizeHelpers - Setting max result buffer size to 322122547 bytes, 30% of the max heap size.
2024-09-04 05:39:47.412 -0700 (,,,,1,32) pool-3-thread-2 : INFO com.tableausoftware.jdbc.FetchSizeHelpers - Setting adaptive fetch size to 2000.
2024-09-04 05:39:47.412 -0700 (,,,,1,32) pool-3-thread-2 : INFO com.tableausoftware.data.ProtobufJDBCResultSet - BindingInfo{columnName='column', columnTypeName='VARCHAR', columnLabel='column', columnType=12, precision=10, scale=0, columnDisplaySize=10, protobufType=STRING, nullable=nullable}
2024-09-04 05:39:47.456 -0700 (,,,,1,32) pool-3-thread-2 : INFO com.tableau.connect.service.QueryTask - Query task for protocol 1 completed.
So Tableau seems to be able to read the view fine. But right after this initial SQL, it runs the enumerateNames
again without any useful logging output and the schema is still not showing up. There is clearly something wrong with Tableau trying to parse the structure. I just can't figure out how to fix that part.
I added the following flags to the manifest.xml
:
<customization name="CAP_JDBC_SUPPRESS_ENUMERATE_DATABASES" value="yes"/>
<customization name="CAP_JDBC_SUPPRESS_ENUMERATE_SCHEMAS" value="yes"/>
and now I don't see the enumerateNames
sequence. The logs are just very quiet. But still no schemas showing up.
My apologies for the spamming but I'm currently running a trial version of Tableau while I'm getting a more permanent license. Should that have an impact?
Hi Chris,
This is an example of the connection-metadata.xml file that is effectively making the catalog ('database') metadata queries being ignored. So the three-level metadata ( catalog / schema / table ) are 'compressed to' the two (schema / table ).
<?xml version='1.0' encoding='utf-8'?>
<connection-metadata>
<database enabled='false'/>
<schema enabled='true' label='Database'/>
<table enabled='true' label='Table' />
</connection-metadata>
You may want to play with the enabling either the 'database' or the 'schema' (not both).
I got it to work! I had to play around with the connection-metadata
and the customizations
but eventually, I started seeing schemas. For anyone else who has that problem, here are the critical parts:
manifest.xml
snippet:
<connection-customization class="db2_jdbc_cloud" enabled="true" version="10.0">
<vendor name="vendor"/>
<driver name="driver"/>
<customizations>
<customization name="CAP_SELECT_INTO" value="no"/>
<customization name="CAP_JDBC_SUPPRESS_EMPTY_CATALOG_NAME" value="yes"/>
<customization name="CAP_JDBC_METADATA_SUPPRESS_PREPARED_QUERY" value="yes"/>
<customization name="CAP_JDBC_METADATA_USE_RESULTSET_FOR_TABLE " value="no"/>
<customization name="CAP_JDBC_METADATA_READ_FOREIGNKEYS" value="no"/>
<customization name="CAP_JDBC_METADATA_READ_PRIMARYKEYS" value="no"/>
<customization name="CAP_JDBC_METADATA_GET_INDEX_INFO" value="no"/>
</customizations>
</connection-customization>
connectionMetadata.xml
snippet:
<connection-metadata>
<database enabled='false' />
<schema enabled='true' />
<table enabled='false' />
</connection-metadata>
Thank you for all your help!
One thing to note is that we followed this example connection-metadata.xml
file, which makes a Database
field show up in the connection dialog triggered by the field
below:
<database enabled='true'>
<field />
</database>
But if we set the database enabled
to false
, that field doesn't show up and we can't use it in the connectionBuilder.js
. I'm not trying to find a way to ask for the database name in the form directly via the connectionFields.xml
. Let me know if you have any advice there.
About You: Name: Chris A Company:
Your question: We took the example JDBC connector and modified it to add new fields to the input form. We are trying to connect to IBM Watson Query via JDBC using the following connection string:
This string works without issues in DBeaver and we can see schemas and views. However, in Tableau, we don't see any schemas at all.
If we leave the default values in the
customization
section of themanifest.xml
(shown here):If we set all the items in the
customization
section tono
, we don't get the syntax exception but only see this:Do you have any advice on what seems to be going wrong here? We know the connection works when connecting from other tools but it doesn't work from Tableau. Any help would be greatly appreciated.