Support for ClickHouse CREATE TABLE .... Engine = MergeTree()

This commit is contained in:
Sergey Olontsev 2025-07-05 07:38:24 +03:00
parent 239e30a97c
commit 3868abaa40
No known key found for this signature in database
GPG key ID: 67DDC06CA52E8A39
2 changed files with 6 additions and 2 deletions

View file

@ -16191,9 +16191,9 @@ impl<'a> Parser<'a> {
fn parse_parenthesized_identifiers(&mut self) -> Result<Vec<Ident>, ParserError> {
self.expect_token(&Token::LParen)?;
let partitions = self.parse_comma_separated(|p| p.parse_identifier())?;
let idents = self.parse_comma_separated0(|p| p.parse_identifier(), Token::RParen)?;
self.expect_token(&Token::RParen)?;
Ok(partitions)
Ok(idents)
}
fn parse_column_position(&mut self) -> Result<Option<MySQLColumnPosition>, ParserError> {

View file

@ -224,6 +224,10 @@ fn parse_create_table() {
clickhouse().verified_stmt(
r#"CREATE TABLE "x" ("a" "int") ENGINE = MergeTree ORDER BY "x" AS SELECT * FROM "t" WHERE true"#,
);
clickhouse().one_statement_parses_to(
"CREATE TABLE x (a int) ENGINE = MergeTree() ORDER BY a",
"CREATE TABLE x (a INT) ENGINE = MergeTree ORDER BY a",
);
}
#[test]