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/09/23 02:49:32 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 fef4442df596b94e0afba023d0eea534ec9833a0
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 eb435f153..3ceb90b00 100644
--- a/src/parser/mod.rs
+++ b/src/parser/mod.rs
@@ -9210,7 +9210,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 258f44367..2f1ce3096 100644
--- a/tests/sqlparser_clickhouse.rs
+++ b/tests/sqlparser_clickhouse.rs
@@ -1879,3 +1879,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