moshap-firebolt opened a new pull request, #2771: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2771
Databricks and Hive both write a `BIGINT` literal with an `L` suffix ([Databricks](https://docs.databricks.com/aws/en/sql/language-manual/data-types/bigint-type), [Hive](https://hive.apache.org/docs/latest/language/languagemanual-types/)), but both dialects read it as an identifier: ```sql SELECT 1L -- Databricks, Hive: Identifier(Ident { value: "1L", .. }) ``` Their numeric-prefix rule, which allows table names like `59901_user_login`, runs before the tokenizer looks for the suffix. Hive's `long_numerics` test passed only because the identifier `1L` prints back unchanged. This adds `Dialect::supports_long_suffix_before_numeric_prefix`, enabled for both: an `L` that ends the number makes it a long, and `1La` is still an identifier. MySQL, which has a numeric prefix but no long literal, keeps reading `1L` as an identifier. As elsewhere in the tokenizer, only an uppercase `L` is a suffix. Databricks `DIV`, `CREATE TABLE ... USING` and `LONG` are left to #2425. Tests in `sqlparser_common.rs` cover 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](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
