Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for TDVT test cases in tickets II-12247, II-12248, II-12251, II-12252, II-12253, II-12254 #39

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

hab6
Copy link
Collaborator

@hab6 hab6 commented Sep 28, 2023

Summary

Remedy failures that occur in TDVT test cases using the Actian JDBC Connector.

TDVT Test Cases Fixed

Jira Ticket Test Set Test Name Without Fix With Fix
II-12247 logical.staples Query.Sort_Alphabetic_DESC_Top1 Failed Passed
II-12248 logical.union calcs.union Failed Passed
II-12251 logical.lod lod.calc.1.TopN Failed Passed
II-12252 logical.staples BUGS.B340 Failed Passed
II-12253 logical.calcs BUGS.B1713 Failed Passed
II-12254 logical.calcs Filter.TopN-context Failed Passed

Test Results

test_results_combined-BeforeFix.csv
test_results_combined-AfterFix.csv

Copy link

@mianculovici mianculovici left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -25,7 +25,7 @@

<customization name="CAP_SELECT_INTO" value="yes"/>
<customization name="CAP_SELECT_TOP_INTO" value="yes"/>
<customization name="CAP_CREATE_TEMP_TABLES" value="yes"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a comment/explanation. I think what you described to me on the phone is fine :-)

From verbal discussion, it looks like Tableau treats this as a "I need to use temporary tables" flag, either for performance reasons or due to possible missing functionality in the backend. Because Vector is so fast, we can handle inline queries, setting to false/no enables this sql push down support. NOTE possible performance implications for Actian X/Ingres with new "no" setting.

You also mentioned that this fixes an unsupported SQL error, due to (what to me looks non-standard, but is probably modern SQL that I'm not familiar with). SELECT INTO table (instead of INSERT AS SELECT...). I think this needs follow up (apologies for the yak shaving suggestion!):

  1. open internal ticket with Vector/Ingres team to confirm SQL syntax (and whether this is something we need to suport) KarlS is top of the list but other engineers need to weigh in.
  2. open ticket/dialog with Bermet and their team on this, is there a way to switch to good-old INSERT AS SELECT? (and link to this). This may be a problem in the future (or with something not covered by the test suite).

CC @iancr01

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "comment", I meant an XML comment in scope.

This also needs to go into ODBC file too

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @clach04 for all the comments. Adding some details here and will address other suggestions separately.

The Tableau Capabilities page explains the setting that was changed to resolved the errors.

Capability Description
CAP_CREATE_TEMP_TABLES Set to ‘yes’ if Tableau can create temporary tables needed for certain complex or optimized queries. Set to ‘no’ if creating temporary tables is not supported.

With this capability set to yes, Tableau was generating SQL SELECT statements with a clause for inserting the retrieved rows into temporary tables, which, from my research, looks to be unsupported by Ingress 11.2 and Vector 6.3. Changing the setting to no removed the temporary table clause and allowed the SQL queries to execute successfully.

Example

Test Name: Query.Sort_Alphabetic_DESC_Top1
Ticket: II-12247

TDVT Error Msg from test_results_combined.csv
Unable to materialize temporary table: A SELECT statement with an INTO clause after the target list may only be used by host language SQL, or in a stored (database) procedure.

Failing - Generated SQL from jprotocolserver.log
SELECT TOP 1 "Staples"."Customer Name" AS "Customer_Name" INTO "zTableau_1_B617B611_E37F_445C_97E3_6B3419F1620D_4_TempTable" FROM "actian"."Staples" "Staples" GROUP BY 1 ORDER BY 1 DESC NULLS LAST

Successful - Fixed Query from test_results_combined.csv
SELECT TOP 1 "Staples"."Customer Name" AS "Customer_Name" FROM "actian"."Staples" "Staples" GROUP BY 1 ORDER BY 1 DESC NULLS LAST

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created internal Jira ticket II-12473 to confirm whether or not Actian databases support the SELECT (col list) INTO (temp table) ... syntax.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set CAP_CREATE_TEMP_TABLES="no" in actian_odbc/manifest.xml to match actian_jdbc/manifest.xml.

Added comments in manifest.xml files explaining reason for setting this value to "no".

@hab6
Copy link
Collaborator Author

hab6 commented Oct 2, 2023

The connector capability setting CAP_CREATE_TEMP_TABLES=no resolves each of the 6 tests listed in this PR.

Jira Ticket Test Name Change Note
II-12247 Query.Sort_Alphabetic_DESC_Top1 Temporary table clause is removed from the Generated SQL
II-12248 calcs.union Generated SQL is changed from 1 statement to 3 statements. This seems unrelated to the capability setting change, although allows the test to succeed. This might need to be looked at again in the future.
II-12251 lod.calc.1.TopN Temporary table clause is removed from the Generated SQL
II-12252 BUGS.B340 Temporary table clause is removed from the Generated SQL
II-12253 BUGS.B1713 Temporary table clause is removed from the Generated SQL
II-12254 Filter.TopN-context Temporary table clause is removed from the Generated SQL

Issue 1185 has been logged with the Tableau Connector SDK team to better understand the connector capability settings CAP_CREATE_TEMP_TABLES and CAP_SELECT_INTO.

Will proceed with merge of this change.

@hab6 hab6 merged commit c9c0efe into master Oct 2, 2023
@hab6 hab6 deleted the hab6-disable-temp-tables branch October 2, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants