Skip to content

Commit 2da0843

Browse files
bitemyappChris A
authored andcommitted
Patch to deal with backticked identifiers in GenericDialect
1 parent 6afd194 commit 2da0843

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/dialect/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub trait Dialect: Debug + Any {
5757
/// MySQL, MS SQL, and sqlite). You can accept one of characters listed
5858
/// in `Word::matching_end_quote` here
5959
fn is_delimited_identifier_start(&self, ch: char) -> bool {
60-
ch == '"'
60+
ch == '"' || ch == '`'
6161
}
6262
/// Determine if quoted characters are proper for identifier
6363
fn is_proper_identifier_inside_quotes(&self, mut _chars: Peekable<Chars<'_>>) -> bool {

tests/sqlparser_hive.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ fn parse_table_create() {
2929
hive().verified_stmt(iof);
3030
}
3131

32+
#[test]
33+
fn parse_describe() {
34+
let describe = r#"DESCRIBE namespace.`table`"#;
35+
hive().verified_stmt(describe);
36+
}
37+
3238
#[test]
3339
fn parse_insert_overwrite() {
3440
let insert_partitions = r#"INSERT OVERWRITE TABLE db.new_table PARTITION (a = '1', b) SELECT a, b, c FROM db.table"#;

0 commit comments

Comments
 (0)