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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2771 +/- ##
==========================================
+ Coverage 83.55% 83.56% +0.01%
==========================================
Files 42 42
Lines 35692 35712 +20
Branches 35692 35712 +20
==========================================
+ Hits 29822 29844 +22
Misses 2429 2429
+ Partials 3441 3439 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sabir-akhadov-localstack
approved these changes
Oct 30, 2026
moshap-firebolt
force-pushed
the
databricks-long-literal
branch
2 times, most recently
from
November 2, 2026 18:31
d9a8008 to
2ef9af2
Compare
moshap-firebolt
force-pushed
the
databricks-long-literal
branch
from
November 20, 2026 15:35
2ef9af2 to
16bb20b
Compare
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>
moshap-firebolt
force-pushed
the
databricks-long-literal
branch
from
November 25, 2026 02:43
16bb20b to
8f49916
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.
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