Skip to content

Enable numeric-prefix identifiers for Databricks dialect#2290

Open
funcpp wants to merge 1 commit intoapache:mainfrom
funcpp:databricks-numeric-prefix-identifier
Open

Enable numeric-prefix identifiers for Databricks dialect#2290
funcpp wants to merge 1 commit intoapache:mainfrom
funcpp:databricks-numeric-prefix-identifier

Conversation

@funcpp
Copy link
Copy Markdown
Contributor

@funcpp funcpp commented Mar 31, 2026

Summary

  • Enable supports_numeric_prefix() for DatabricksDialect

Databricks is built on Spark SQL, whose ANTLR lexer defines identifiers without restricting the first character:

IDENTIFIER: (UNICODE_LETTER | DIGIT | '_')+

This allows table names like catalog.schema.1st_table to parse correctly. Without this flag, .1 in schema.1st_table is tokenized as a decimal literal.

Test plan

  • New tests: catalog.schema.1st_table, a.b.1c
  • Existing numeric prefix tests in sqlparser_common.rs automatically include Databricks via all_dialects_where
  • Full test suite passes

Databricks, built on Spark SQL, allows identifiers that start with
digits. The Spark SQL ANTLR lexer defines IDENTIFIER as
(UNICODE_LETTER | DIGIT | '_')+, with no restriction on the first
character.

Enable the existing supports_numeric_prefix() for DatabricksDialect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant