Fix Ignite connector to use standard SQL identifier quoting#29484
Fix Ignite connector to use standard SQL identifier quoting#29484yadavay-amzn wants to merge 1 commit into
Conversation
|
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
194360d to
a1a52bd
Compare
Change identifier quote from backtick to double-quote in IgniteClient. Ignite SQL requires double-quotes for case-sensitive identifiers. The existing IdentifierMapping infrastructure handles the uppercase folding (storesUpperCaseIdentifiers=true) automatically, matching the pattern used by Oracle and Snowflake connectors. Fixes trinodb#29303
a1a52bd to
5eea2b2
Compare
|
@ebyhr I fixed the test failures and pushed a new commit. CI is re-running for theses and i verified that the tests pass locally now. |
Fixes #29303.
Problem
The Ignite connector uses backtick as identifier quote character, but Ignite SQL does not recognize backticks. This prevents creating tables with mixed-case identifiers.
Fix
Two changes:
Change identifier quote from backtick to double-quote in
IgniteClient. Ignite SQL requires double-quotes for case-sensitive identifiers per SQL standard.Override
getRemoteIdentifiers()to forcestoresUpperCaseIdentifiers=true. Ignite stores unquoted identifiers as uppercase, but its JDBC driver does not report this correctly viaDatabaseMetaData.storesUpperCaseIdentifiers(). The override ensuresDefaultIdentifierMappinguppercases identifiers before quoting, so Trino's lowercasepublicbecomes"PUBLIC"when sent to Ignite. This is the same pattern used by DruidJdbcClient.Why the prior attempt (#29307) was closed
The prior contributor noted that swapping the quote character breaks schema resolution (
"public"!=PUBLIC). They missed that theIdentifierMappinginfrastructure handles this, but, only whenstoresUpperCaseIdentifiers()returns true, which Ignite's driver does not report correctly. ThegetRemoteIdentifiers()override fixes this.Testing
All Ignite plugin tests pass locally (361 tests):
TestIgniteClient(5/5) -- SQL generation with double-quote quotingTestIgniteCaseInsensitiveMapping(10/10) -- case-insensitive identifier resolutionTestIgniteConnectorTest(346/346) -- full connector integration tests