Skip to content

Commit 3868aba

Browse files
committed
Support for ClickHouse CREATE TABLE .... Engine = MergeTree()
1 parent 239e30a commit 3868aba

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/parser/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16191,9 +16191,9 @@ impl<'a> Parser<'a> {
1619116191

1619216192
fn parse_parenthesized_identifiers(&mut self) -> Result<Vec<Ident>, ParserError> {
1619316193
self.expect_token(&Token::LParen)?;
16194-
let partitions = self.parse_comma_separated(|p| p.parse_identifier())?;
16194+
let idents = self.parse_comma_separated0(|p| p.parse_identifier(), Token::RParen)?;
1619516195
self.expect_token(&Token::RParen)?;
16196-
Ok(partitions)
16196+
Ok(idents)
1619716197
}
1619816198

1619916199
fn parse_column_position(&mut self) -> Result<Option<MySQLColumnPosition>, ParserError> {

tests/sqlparser_clickhouse.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ fn parse_create_table() {
224224
clickhouse().verified_stmt(
225225
r#"CREATE TABLE "x" ("a" "int") ENGINE = MergeTree ORDER BY "x" AS SELECT * FROM "t" WHERE true"#,
226226
);
227+
clickhouse().one_statement_parses_to(
228+
"CREATE TABLE x (a int) ENGINE = MergeTree() ORDER BY a",
229+
"CREATE TABLE x (a INT) ENGINE = MergeTree ORDER BY a",
230+
);
227231
}
228232

229233
#[test]

0 commit comments

Comments
 (0)