Conversation
Lets a dialect parse the name of a table in a table factor, falling back to parse_object_name when it returns None. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hb9YMy3Ay2oNWagfTz2KzZ
|
No dialect label was applied because the title does not name a SQL dialect. If this change targets one or more dialects, edit the title to |
Yeah in my opinion the clean solution will be at some point to refactor the tokenizer dialect-generic, so tokenization can be optimally implemented for each dialect. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2610 +/- ##
==========================================
- Coverage 81.14% 81.13% -0.02%
==========================================
Files 42 42
Lines 33736 33748 +12
Branches 33736 33748 +12
==========================================
+ Hits 27376 27382 +6
- Misses 2797 2803 +6
Partials 3563 3563 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hb9YMy3Ay2oNWagfTz2KzZ
|
Agreed that a dialect-specific tokenizer is the right long-term fix for lexing. For Presto, I'm open to working on the tokenizer side too. If useful, I can open an issue sketching it, for example a |
Closes #2604.
Dialectcan override expression, statement and column-option parsing, but not table names:parse_table_factoralways callsparse_object_name(true). A downstream dialect with syntax likeFROM events:analyticshas to rewrite tokens before parsing.This adds
parse_table_factor_name, which works likeparse_prefix/parse_statement: returnNoneto fall back to the default parser. Only the name is replaced; alias, joins, sampling and hints still go through the core parser. Note thatObjectNameprints its parts joined with., so custom separators don't round-trip.derive_dialect's generated imports gainObjectNameso derived dialects compile.Dialects: none
Tests:
custom_table_factor_name_parserintests/sqlparser_custom_dialect.rs.Implemented with AI assistance (Claude Code).
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hb9YMy3Ay2oNWagfTz2KzZ