fix(arrow): quote identifiers in generated DDL for Arrow-backed tables (#756) - #761
Open
adsharma wants to merge 1 commit into
Open
fix(arrow): quote identifiers in generated DDL for Arrow-backed tables (#756)#761adsharma wants to merge 1 commit into
adsharma wants to merge 1 commit into
Conversation
Add a quoteIdent helper and wrap every identifier interpolation in createViewFromArrowTable, createRelTableFromArrowTable, createRelTableFromArrowCSR, and unregisterArrowTable. Arrow field names and caller-supplied table names are arbitrary strings; many ordinary ones (index, order, group, names with a space or leading digit) are not valid unquoted Cypher identifiers and would cause parser rejection. Also add tests: - CreateArrowTableReservedFieldNames: column names 'index' and 'value' - CreateArrowTableIrregularFieldNames: column names 'my column' and '2nd' - CreateArrowRelTableReservedTableName: rel table name 'index' Release note: callers that previously worked around this bug by pre-quoting Arrow field names with backticks will now get double-quoted identifiers (``index``) and fail. Those backticks should be removed from the Arrow field names.
adsharma
force-pushed
the
fix/756-quote-arrow-identifiers
branch
from
July 30, 2026 19:58
21a6fc0 to
8ce3c81
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #756
ArrowTableSupport::createViewFromArrowTable,createRelTableFromArrowTable, andcreateRelTableFromArrowCSRbuilt theirCREATE NODE TABLE/CREATE REL TABLEstatements by string concatenation, never quoting the Arrow field names or the caller-supplied table names. Many ordinary names (index,order,group,end,default, names with a space, names with a leading digit) are not valid unquoted Cypher identifiers and were rejected by the parser.Change (
src/storage/table/arrow_table_support.cpp):quoteIdenthelper (file-scoped in thelbugnamespace, matching the existingjoinandfindArrowColumnByNamehelpers): wraps an identifier in backticks.CREATE ... TABLEbuilders are now wrapped inquoteIdent(...): column names, table name, primary-key column, and theFROM/TOendpoint table names in the rel-table builders.unregisterArrowTablebuilds aDROP TABLEstatement with the same unquoted identifier. Without fixing it, a table created via this PR with a reserved name would have been un-droppable. Now also quoted.Tests added (3, all pass):
ArrowNodeTableTest.CreateArrowTableReservedFieldNames— columns namedindexandvalueArrowNodeTableTest.CreateArrowTableIrregularFieldNames— columns namedmy columnand2nd(the harder cases)ArrowRelTableTest.CreateArrowRelTableReservedTableName— rel table itself namedindexAll 50 arrow tests continue to pass; 14 pre-existing skips, 0 regressions.
Release note: callers that previously worked around this bug by pre-quoting Arrow field names with backticks (so the generated DDL happened to be correct) will now get double-quoted identifiers (
`\`index\``) and fail. Those backticks should be removed from the Arrow field names.Out of scope (per the issue author):
LogicalType::toString()forSTRUCTmember names is a design call left for a separate look;STRUCTmember quoting still fails after this change.Transformer::transformSymbolicNameis a separate parser issue; not addressed here.