Skip to content

Commit aa43c25

Browse files
authored
Enable numeric-prefix identifiers for Databricks dialect (#2290)
1 parent fe88fd1 commit aa43c25

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/dialect/databricks.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ impl Dialect for DatabricksDialect {
3939
matches!(ch, 'a'..='z' | 'A'..='Z' | '0'..='9' | '_')
4040
}
4141

42+
fn supports_numeric_prefix(&self) -> bool {
43+
true
44+
}
45+
4246
fn supports_filter_during_aggregation(&self) -> bool {
4347
true
4448
}

tests/sqlparser_databricks.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,3 +644,10 @@ fn parse_databricks_json_accessor() {
644644
"SELECT raw:store.bicycle.price::DOUBLE FROM store_data",
645645
);
646646
}
647+
648+
#[test]
649+
fn parse_numeric_prefix_identifier() {
650+
databricks().verified_stmt("SELECT * FROM catalog.schema.1st_table");
651+
652+
databricks().verified_stmt("SELECT * FROM a.b.1c");
653+
}

0 commit comments

Comments
 (0)