You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by lu...@apache.org on 2026/10/08 20:10:30 UTC
(datafusion-sqlparser-rs) 01/01: Generic: Keep the quoting of the CREATE TABLE ENGINE name
This is an automated email from the ASF dual-hosted git repository.
LucaCappelletti94 pushed a commit to branch engine-name-quoting
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git
commit a56cdbc667b0b5fdb51593c9f9bad79351e47d55
Author: LucaCappelletti94 <ca...@gmail.com>
AuthorDate: Wed Sep 23 04:49:21 2026 +0200
Generic: Keep the quoting of the CREATE TABLE ENGINE name
---
src/parser/mod.rs | 2 +-
tests/sqlparser_clickhouse.rs | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/parser/mod.rs b/src/parser/mod.rs
index 1a46c6e5..8bee98f0 100644
--- a/src/parser/mod.rs
+++ b/src/parser/mod.rs
@@ -9283,7 +9283,7 @@ impl<'a> Parser<'a> {
Ok(Some(SqlOption::NamedParenthesizedList(
NamedParenthesizedList {
key: Ident::new("ENGINE"),
- name: Some(Ident::new(w.value)),
+ name: Some(w.into_ident(value.span)),
values: parameters,
},
)))
diff --git a/tests/sqlparser_clickhouse.rs b/tests/sqlparser_clickhouse.rs
index 17d55852..5dc12ee5 100644
--- a/tests/sqlparser_clickhouse.rs
+++ b/tests/sqlparser_clickhouse.rs
@@ -2094,3 +2094,11 @@ fn clickhouse_and_generic() -> TestedDialects {
Box::new(GenericDialect {}),
])
}
+
+#[test]
+fn parse_create_table_engine_name_quoting() {
+ clickhouse_and_generic().verified_stmt(r#"CREATE TABLE t (a INT) ENGINE = "MergeTree""#);
+ clickhouse_and_generic().verified_stmt("CREATE TABLE t (a INT) ENGINE = `MergeTree`");
+ clickhouse_and_generic().verified_stmt("CREATE TABLE t (a INT) ENGINE = ``");
+ clickhouse().verified_stmt("CREATE TABLE t (a INT) ENGINE = MergeTree");
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org