Repository navigation
Databricks, Hive: parse 1L as a long literal - #2771
Open
moshap-firebolt wants to merge 2 commits into
Open
moshap-firebolt wants to merge 2 commits into
moshap-firebolt wants to merge 2 commits into
Conversation
Both dialects read `1L` as an identifier, since the numeric-prefix rule (tables named `59901_user_login`) ran before the long suffix. A new dialect method, supports_long_suffix_before_numeric_prefix, lets an `L` that ends the number win; `1La` is still an identifier. MySQL, which has no long literal, keeps reading `1L` as an identifier. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2771 +/- ##
==========================================
+ Coverage 82.52% 82.55% +0.03%
==========================================
Files 42 42
Lines 35533 35573 +40
Branches 35533 35573 +40
==========================================
+ Hits 29323 29368 +45
+ Misses 2675 2672 -3
+ Partials 3535 3533 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sabir-akhadov-localstack
approved these changes
Oct 30, 2026
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.
Databricks and Hive both write a
BIGINTliteral with anLsuffix (Databricks, Hive), but both dialects read it as an identifier:Their numeric-prefix rule, which allows table names like
59901_user_login, runs before the tokenizer looks for the suffix. Hive'slong_numericstest passed only because the identifier1Lprints back unchanged.This adds
Dialect::supports_long_suffix_before_numeric_prefix, enabled for both: anLthat ends the number makes it a long, and1Lais still an identifier. MySQL, which has a numeric prefix but no long literal, keeps reading1Las an identifier. As elsewhere in the tokenizer, only an uppercaseLis a suffix. DatabricksDIV,CREATE TABLE ... USINGandLONGare left to #2425.Tests in
sqlparser_common.rscover dialects with and without the method; they fail without the change.This PR was prepared with AI assistance (Claude).
Dialects: Databricks, Hive
🤖 Generated with Claude Code