diff --git a/parser/ast.go b/parser/ast.go index 0d3c777..bb660fe 100644 --- a/parser/ast.go +++ b/parser/ast.go @@ -4817,14 +4817,18 @@ func (e *EngineExpr) String() string { if e.Params != nil { builder.WriteString(e.Params.String()) } - if e.PrimaryKey != nil { + if e.OrderBy != nil { builder.WriteString(" ") - builder.WriteString(e.PrimaryKey.String()) + builder.WriteString(e.OrderBy.String()) } if e.PartitionBy != nil { builder.WriteString(" ") builder.WriteString(e.PartitionBy.String()) } + if e.PrimaryKey != nil { + builder.WriteString(" ") + builder.WriteString(e.PrimaryKey.String()) + } if e.SampleBy != nil { builder.WriteString(" ") builder.WriteString(e.SampleBy.String()) @@ -4837,10 +4841,6 @@ func (e *EngineExpr) String() string { builder.WriteString(" ") builder.WriteString(e.Settings.String()) } - if e.OrderBy != nil { - builder.WriteString(" ") - builder.WriteString(e.OrderBy.String()) - } return builder.String() } diff --git a/parser/testdata/ddl/format/attach_table_basic.sql b/parser/testdata/ddl/format/attach_table_basic.sql index c98e5f7..09b3c12 100644 --- a/parser/testdata/ddl/format/attach_table_basic.sql +++ b/parser/testdata/ddl/format/attach_table_basic.sql @@ -14,4 +14,4 @@ PARTITION BY toYYYYMMDD(f3) ORDER BY (f0,f1,f2); -- Format SQL: -CREATE TABLE IF NOT EXISTS test.events_local ON CLUSTER 'default_cluster' (f0 String, f1 String, f2 String, f3 Datetime, f4 Datetime, f5 Map(String, String), f6 String, f7 Datetime DEFAULT now()) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/test/events_local', '{replica}') PARTITION BY toYYYYMMDD(f3) TTL f3 + INTERVAL 6 MONTH ORDER BY (f0, f1, f2); +CREATE TABLE IF NOT EXISTS test.events_local ON CLUSTER 'default_cluster' (f0 String, f1 String, f2 String, f3 Datetime, f4 Datetime, f5 Map(String, String), f6 String, f7 Datetime DEFAULT now()) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/test/events_local', '{replica}') ORDER BY (f0, f1, f2) PARTITION BY toYYYYMMDD(f3) TTL f3 + INTERVAL 6 MONTH; diff --git a/parser/testdata/ddl/format/create_materialized_view_with_empty_table_schema.sql b/parser/testdata/ddl/format/create_materialized_view_with_empty_table_schema.sql index 481f9a0..3170b66 100644 --- a/parser/testdata/ddl/format/create_materialized_view_with_empty_table_schema.sql +++ b/parser/testdata/ddl/format/create_materialized_view_with_empty_table_schema.sql @@ -16,4 +16,4 @@ from where rn = 1; -- Format SQL: -CREATE MATERIALIZED VIEW test.t0 ON CLUSTER default_cluster ENGINE = ReplicatedAggregatingMergeTree('/clickhouse/{layer}-{shard}/test/t0', '{replica}') PARTITION BY toYYYYMM(f0) ORDER BY (f0) POPULATE AS SELECT f0, f1, f2, coalesce(f0, f1) AS f333 FROM (SELECT f0, f1, f2, ROW_NUMBER() OVER (PARTITION BY f0 ORDER BY coalesce(f1, f2)) AS rn FROM test.t WHERE f3 IN ('foo', 'bar', 'test') AND env = 'test') AS tmp WHERE rn = 1; +CREATE MATERIALIZED VIEW test.t0 ON CLUSTER default_cluster ENGINE = ReplicatedAggregatingMergeTree('/clickhouse/{layer}-{shard}/test/t0', '{replica}') ORDER BY (f0) PARTITION BY toYYYYMM(f0) POPULATE AS SELECT f0, f1, f2, coalesce(f0, f1) AS f333 FROM (SELECT f0, f1, f2, ROW_NUMBER() OVER (PARTITION BY f0 ORDER BY coalesce(f1, f2)) AS rn FROM test.t WHERE f3 IN ('foo', 'bar', 'test') AND env = 'test') AS tmp WHERE rn = 1; diff --git a/parser/testdata/ddl/format/create_mv_with_order_by.sql b/parser/testdata/ddl/format/create_mv_with_order_by.sql index 8c40585..004d56e 100644 --- a/parser/testdata/ddl/format/create_mv_with_order_by.sql +++ b/parser/testdata/ddl/format/create_mv_with_order_by.sql @@ -13,5 +13,5 @@ AS SELECT * FROM test_table; -- Format SQL: -CREATE MATERIALIZED VIEW IF NOT EXISTS test_mv ENGINE = ReplacingMergeTree() PRIMARY KEY (id) ORDER BY (id) AS SELECT * FROM test_table; +CREATE MATERIALIZED VIEW IF NOT EXISTS test_mv ENGINE = ReplacingMergeTree() ORDER BY (id) PRIMARY KEY (id) AS SELECT * FROM test_table; CREATE MATERIALIZED VIEW IF NOT EXISTS test_mv ENGINE = ReplacingMergeTree() PRIMARY KEY (id) AS SELECT * FROM test_table; diff --git a/parser/testdata/ddl/format/create_or_replace.sql b/parser/testdata/ddl/format/create_or_replace.sql index 714c070..aa38dbe 100644 --- a/parser/testdata/ddl/format/create_or_replace.sql +++ b/parser/testdata/ddl/format/create_or_replace.sql @@ -26,6 +26,6 @@ FROM CREATE OR REPLACE FUNCTION IF NOT EXISTS my_function AS (x, y) -> x + y; -- Format SQL: -CREATE OR REPLACE TABLE IF NOT EXISTS test.events_local (f0 String, f1 String CODEC(ZSTD(1)), f2 VARCHAR(255)) ENGINE = MergeTree PRIMARY KEY (f0, f1, f2) PARTITION BY toYYYYMMDD(f1) TTL f1 + INTERVAL 6 MONTH ORDER BY (f1, f2) COMMENT 'Comment for table'; +CREATE OR REPLACE TABLE IF NOT EXISTS test.events_local (f0 String, f1 String CODEC(ZSTD(1)), f2 VARCHAR(255)) ENGINE = MergeTree ORDER BY (f1, f2) PARTITION BY toYYYYMMDD(f1) PRIMARY KEY (f0, f1, f2) TTL f1 + INTERVAL 6 MONTH COMMENT 'Comment for table'; CREATE OR REPLACE VIEW IF NOT EXISTS my_view (col1 String, col2 String) AS SELECT id, name FROM my_table; CREATE OR REPLACE FUNCTION IF NOT EXISTS my_function AS (x, y) -> x + y; diff --git a/parser/testdata/ddl/format/create_table_basic.sql b/parser/testdata/ddl/format/create_table_basic.sql index dcf71a4..0a9f2f3 100644 --- a/parser/testdata/ddl/format/create_table_basic.sql +++ b/parser/testdata/ddl/format/create_table_basic.sql @@ -32,4 +32,4 @@ ORDER BY (f1,f2,f3) COMMENT 'Comment for table'; -- Format SQL: -CREATE TABLE IF NOT EXISTS test.events_local (f0 String, f1 String CODEC(ZSTD(1)), f2 VARCHAR(255), f3 Datetime, f4 Datetime, f5 Map(String, String), f6 String, f7 Nested(f70 UInt32, f71 UInt32, f72 DateTime, f73 Int64, f74 Int64, f75 String), f8 Datetime DEFAULT now(), f9 String MATERIALIZED toString(f7['f70']), f10 String ALIAS f11, f12 JSON(max_dynamic_types=10, max_dynamic_paths=3, SKIP a, SKIP a.b.c, SKIP REGEXP 'hello')) ENGINE = MergeTree PRIMARY KEY (f0, f1, f2) PARTITION BY toYYYYMMDD(f3) TTL f3 + INTERVAL 6 MONTH ORDER BY (f1, f2, f3) COMMENT 'Comment for table'; +CREATE TABLE IF NOT EXISTS test.events_local (f0 String, f1 String CODEC(ZSTD(1)), f2 VARCHAR(255), f3 Datetime, f4 Datetime, f5 Map(String, String), f6 String, f7 Nested(f70 UInt32, f71 UInt32, f72 DateTime, f73 Int64, f74 Int64, f75 String), f8 Datetime DEFAULT now(), f9 String MATERIALIZED toString(f7['f70']), f10 String ALIAS f11, f12 JSON(max_dynamic_types=10, max_dynamic_paths=3, SKIP a, SKIP a.b.c, SKIP REGEXP 'hello')) ENGINE = MergeTree ORDER BY (f1, f2, f3) PARTITION BY toYYYYMMDD(f3) PRIMARY KEY (f0, f1, f2) TTL f3 + INTERVAL 6 MONTH COMMENT 'Comment for table'; diff --git a/parser/testdata/ddl/format/create_table_with_codec_delta.sql b/parser/testdata/ddl/format/create_table_with_codec_delta.sql index 6d2a5ac..6122af4 100644 --- a/parser/testdata/ddl/format/create_table_with_codec_delta.sql +++ b/parser/testdata/ddl/format/create_table_with_codec_delta.sql @@ -18,4 +18,4 @@ SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity -- Format SQL: -CREATE TABLE IF NOT EXISTS test_local (`id` UInt64 CODEC(Delta, ZSTD(1)), `api_id` UInt64 CODEC(ZSTD(1)), `app_id` UInt64 CODEC(Delta(9), ZSTD(1)), `device_id` UInt64 CODEC(DoubleDelta, ZSTD(1)), `guage` Float64 CODEC(Gorilla, LZ4), `value` UInt64 CODEC(T64, LZ4), `timestamp` DateTime64(9) CODEC(ZSTD(1)), INDEX timestamp_index(timestamp) TYPE minmax GRANULARITY 4) ENGINE = ReplicatedMergeTree('/root/test_local', '{replica}') PARTITION BY toStartOfHour(`timestamp`) TTL toStartOfHour(`timestamp`) + INTERVAL 7 DAY, toStartOfHour(`timestamp`) + INTERVAL 2 DAY SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity=16384, max_bytes_to_merge_at_max_space_in_pool=64424509440, storage_policy='main', ttl_only_drop_parts=1 ORDER BY (toUnixTimestamp64Nano(`timestamp`), `api_id`); +CREATE TABLE IF NOT EXISTS test_local (`id` UInt64 CODEC(Delta, ZSTD(1)), `api_id` UInt64 CODEC(ZSTD(1)), `app_id` UInt64 CODEC(Delta(9), ZSTD(1)), `device_id` UInt64 CODEC(DoubleDelta, ZSTD(1)), `guage` Float64 CODEC(Gorilla, LZ4), `value` UInt64 CODEC(T64, LZ4), `timestamp` DateTime64(9) CODEC(ZSTD(1)), INDEX timestamp_index(timestamp) TYPE minmax GRANULARITY 4) ENGINE = ReplicatedMergeTree('/root/test_local', '{replica}') ORDER BY (toUnixTimestamp64Nano(`timestamp`), `api_id`) PARTITION BY toStartOfHour(`timestamp`) TTL toStartOfHour(`timestamp`) + INTERVAL 7 DAY, toStartOfHour(`timestamp`) + INTERVAL 2 DAY SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity=16384, max_bytes_to_merge_at_max_space_in_pool=64424509440, storage_policy='main', ttl_only_drop_parts=1; diff --git a/parser/testdata/ddl/format/create_table_with_enum_fields.sql b/parser/testdata/ddl/format/create_table_with_enum_fields.sql index 220adf3..54f6a83 100644 --- a/parser/testdata/ddl/format/create_table_with_enum_fields.sql +++ b/parser/testdata/ddl/format/create_table_with_enum_fields.sql @@ -11,4 +11,4 @@ TTL toDate(timestamp) + toIntervalDay(3) SETTINGS index_granularity = 8192; -- Format SQL: -CREATE TABLE t0 ON CLUSTER default_cluster (`method` Enum8('GET'=1, 'POST'=2, 'HEAD'=3, 'PUT'=4, 'PATCH'=5, 'DELETE'=6, 'CONNECT'=7, 'OPTIONS'=8, 'TRACE'=9) CODEC(ZSTD(1)), `timestamp` DateTime64(3) CODEC(DoubleDelta, ZSTD)) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}', '{replica}') PARTITION BY toDate(timestamp) TTL toDate(timestamp) + toIntervalDay(3) SETTINGS index_granularity=8192 ORDER BY (method, timestamp); +CREATE TABLE t0 ON CLUSTER default_cluster (`method` Enum8('GET'=1, 'POST'=2, 'HEAD'=3, 'PUT'=4, 'PATCH'=5, 'DELETE'=6, 'CONNECT'=7, 'OPTIONS'=8, 'TRACE'=9) CODEC(ZSTD(1)), `timestamp` DateTime64(3) CODEC(DoubleDelta, ZSTD)) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}', '{replica}') ORDER BY (method, timestamp) PARTITION BY toDate(timestamp) TTL toDate(timestamp) + toIntervalDay(3) SETTINGS index_granularity=8192; diff --git a/parser/testdata/ddl/format/create_table_with_index.sql b/parser/testdata/ddl/format/create_table_with_index.sql index 5bf1df6..4d48125 100644 --- a/parser/testdata/ddl/format/create_table_with_index.sql +++ b/parser/testdata/ddl/format/create_table_with_index.sql @@ -22,4 +22,4 @@ SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity -- Format SQL: -CREATE TABLE IF NOT EXISTS test_local (`common.id` String CODEC(ZSTD(1)), `id` UInt64 CODEC(Delta, ZSTD(1)), `api_id` UInt64 CODEC(ZSTD(1)), `arr` Array(Int64), `content` String CODEC(ZSTD(1)), `output` String, INDEX id_common_id_bloom_filter common.id TYPE bloom_filter(0.001) GRANULARITY 1, INDEX id_idx id TYPE minmax GRANULARITY 10, INDEX api_id_idx api_id TYPE set(100) GRANULARITY 2, INDEX arr_idx arr TYPE bloom_filter(0.01) GRANULARITY 3, INDEX content_idx content TYPE tokenbf_v1(30720, 2, 0) GRANULARITY 1, INDEX output_idx output TYPE ngrambf_v1(3, 10000, 2, 1) GRANULARITY 2) ENGINE = ReplicatedMergeTree('/root/test_local', '{replica}') PARTITION BY toStartOfHour(`timestamp`) TTL toStartOfHour(`timestamp`) + INTERVAL 7 DAY, toStartOfHour(`timestamp`) + INTERVAL 2 DAY SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity=16384, max_bytes_to_merge_at_max_space_in_pool=64424509440, storage_policy='main', ttl_only_drop_parts=1 ORDER BY (toUnixTimestamp64Nano(`timestamp`), `api_id`); +CREATE TABLE IF NOT EXISTS test_local (`common.id` String CODEC(ZSTD(1)), `id` UInt64 CODEC(Delta, ZSTD(1)), `api_id` UInt64 CODEC(ZSTD(1)), `arr` Array(Int64), `content` String CODEC(ZSTD(1)), `output` String, INDEX id_common_id_bloom_filter common.id TYPE bloom_filter(0.001) GRANULARITY 1, INDEX id_idx id TYPE minmax GRANULARITY 10, INDEX api_id_idx api_id TYPE set(100) GRANULARITY 2, INDEX arr_idx arr TYPE bloom_filter(0.01) GRANULARITY 3, INDEX content_idx content TYPE tokenbf_v1(30720, 2, 0) GRANULARITY 1, INDEX output_idx output TYPE ngrambf_v1(3, 10000, 2, 1) GRANULARITY 2) ENGINE = ReplicatedMergeTree('/root/test_local', '{replica}') ORDER BY (toUnixTimestamp64Nano(`timestamp`), `api_id`) PARTITION BY toStartOfHour(`timestamp`) TTL toStartOfHour(`timestamp`) + INTERVAL 7 DAY, toStartOfHour(`timestamp`) + INTERVAL 2 DAY SETTINGS execute_merges_on_single_replica_time_threshold=1200, index_granularity=16384, max_bytes_to_merge_at_max_space_in_pool=64424509440, storage_policy='main', ttl_only_drop_parts=1; diff --git a/parser/testdata/ddl/format/create_table_with_keyword_partition_by.sql b/parser/testdata/ddl/format/create_table_with_keyword_partition_by.sql index af3956c..f288046 100644 --- a/parser/testdata/ddl/format/create_table_with_keyword_partition_by.sql +++ b/parser/testdata/ddl/format/create_table_with_keyword_partition_by.sql @@ -10,4 +10,4 @@ CREATE TABLE test.events_local UUID 'dad17568-b070-49d0-9ad1-7568b07029d0' ( SETTINGS index_granularity = 8192; -- Format SQL: -CREATE TABLE test.events_local UUID 'dad17568-b070-49d0-9ad1-7568b07029d0' (`date` Date, `f1` String, `f2` String, `f3` UInt64) ENGINE = ReplacingMergeTree PARTITION BY date SETTINGS index_granularity=8192 ORDER BY (f1, f2); +CREATE TABLE test.events_local UUID 'dad17568-b070-49d0-9ad1-7568b07029d0' (`date` Date, `f1` String, `f2` String, `f3` UInt64) ENGINE = ReplacingMergeTree ORDER BY (f1, f2) PARTITION BY date SETTINGS index_granularity=8192; diff --git a/parser/testdata/ddl/format/create_table_with_nullable.sql b/parser/testdata/ddl/format/create_table_with_nullable.sql index f2b9df9..73f1e4c 100644 --- a/parser/testdata/ddl/format/create_table_with_nullable.sql +++ b/parser/testdata/ddl/format/create_table_with_nullable.sql @@ -15,4 +15,4 @@ SETTINGS index_granularity = 8192; -- Format SQL: -CREATE TABLE test.`.inner.752391fb-44cc-4dd5-b523-91fb44cc9dd5` UUID '27673372-7973-44f5-a767-33727973c4f5' (`f0` String, `f1` String, `f2` LowCardinality(String), `f3` LowCardinality(String), `f4` DateTime64(3), `f5` Nullable(DateTime64(3)), `succeed_at` Nullable(DateTime64(3))) ENGINE = MergeTree PARTITION BY xxHash32(tag_id) % 20 SETTINGS index_granularity=8192 ORDER BY label_id; +CREATE TABLE test.`.inner.752391fb-44cc-4dd5-b523-91fb44cc9dd5` UUID '27673372-7973-44f5-a767-33727973c4f5' (`f0` String, `f1` String, `f2` LowCardinality(String), `f3` LowCardinality(String), `f4` DateTime64(3), `f5` Nullable(DateTime64(3)), `succeed_at` Nullable(DateTime64(3))) ENGINE = MergeTree ORDER BY label_id PARTITION BY xxHash32(tag_id) % 20 SETTINGS index_granularity=8192; diff --git a/parser/testdata/ddl/format/create_table_with_on_clsuter.sql b/parser/testdata/ddl/format/create_table_with_on_clsuter.sql index d7eb0c3..71fbcad 100644 --- a/parser/testdata/ddl/format/create_table_with_on_clsuter.sql +++ b/parser/testdata/ddl/format/create_table_with_on_clsuter.sql @@ -14,4 +14,4 @@ PARTITION BY toYYYYMMDD(f3) ORDER BY (f0,f1,f2); -- Format SQL: -CREATE TABLE IF NOT EXISTS test.events_local ON CLUSTER 'default_cluster' (f0 String, f1 String, f2 String, f3 Datetime, f4 Datetime, f5 Map(String, String), f6 String, f7 Datetime DEFAULT now()) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/test/events_local', '{replica}') PARTITION BY toYYYYMMDD(f3) TTL f3 + INTERVAL 6 MONTH ORDER BY (f0, f1, f2); +CREATE TABLE IF NOT EXISTS test.events_local ON CLUSTER 'default_cluster' (f0 String, f1 String, f2 String, f3 Datetime, f4 Datetime, f5 Map(String, String), f6 String, f7 Datetime DEFAULT now()) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/test/events_local', '{replica}') ORDER BY (f0, f1, f2) PARTITION BY toYYYYMMDD(f3) TTL f3 + INTERVAL 6 MONTH; diff --git a/parser/testdata/ddl/format/create_table_with_sample_by.sql b/parser/testdata/ddl/format/create_table_with_sample_by.sql index d61b119..cbc4ae0 100644 --- a/parser/testdata/ddl/format/create_table_with_sample_by.sql +++ b/parser/testdata/ddl/format/create_table_with_sample_by.sql @@ -12,4 +12,4 @@ SAMPLE BY userid SETTINGS index_granularity = 8192; -- Format SQL: -CREATE TABLE default.test UUID '87887901-e33c-497e-8788-7901e33c997e' (`f0` DateTime, `f1` UInt32, `f3` UInt32) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}/{shard}/default/test', '{replica}') PARTITION BY toYYYYMM(timestamp) SAMPLE BY userid SETTINGS index_granularity=8192 ORDER BY (contractid, toDate(timestamp), userid); +CREATE TABLE default.test UUID '87887901-e33c-497e-8788-7901e33c997e' (`f0` DateTime, `f1` UInt32, `f3` UInt32) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}/{shard}/default/test', '{replica}') ORDER BY (contractid, toDate(timestamp), userid) PARTITION BY toYYYYMM(timestamp) SAMPLE BY userid SETTINGS index_granularity=8192; diff --git a/parser/testdata/ddl/format/create_table_with_ttl_policy.sql b/parser/testdata/ddl/format/create_table_with_ttl_policy.sql index 160da67..8e2287d 100644 --- a/parser/testdata/ddl/format/create_table_with_ttl_policy.sql +++ b/parser/testdata/ddl/format/create_table_with_ttl_policy.sql @@ -35,6 +35,6 @@ SETTINGS min_rows_for_wide_part = 0, min_bytes_for_wide_part = 0; -- Format SQL: -CREATE TABLE tab (d DateTime, a Int) ENGINE = MergeTree PARTITION BY toYYYYMM(d) TTL d + INTERVAL 1 MONTH DELETE, d + INTERVAL 1 WEEK TO VOLUME 'aaa', d + INTERVAL 2 WEEK TO DISK 'bbb' ORDER BY d; -CREATE TABLE table_with_where (d DateTime, a Int) ENGINE = MergeTree PARTITION BY toYYYYMM(d) TTL d + INTERVAL 1 MONTH DELETE WHERE toDayOfWeek(d) = 1 ORDER BY d; -CREATE TABLE table_for_recompression (d DateTime, key UInt64, value String) ENGINE = MergeTree() PARTITION BY key TTL d + INTERVAL 1 MONTH RECOMPRESS CODEC(ZSTD(17)), d + INTERVAL 1 YEAR RECOMPRESS CODEC(LZ4HC(10)) SETTINGS min_rows_for_wide_part=0, min_bytes_for_wide_part=0 ORDER BY tuple(); +CREATE TABLE tab (d DateTime, a Int) ENGINE = MergeTree ORDER BY d PARTITION BY toYYYYMM(d) TTL d + INTERVAL 1 MONTH DELETE, d + INTERVAL 1 WEEK TO VOLUME 'aaa', d + INTERVAL 2 WEEK TO DISK 'bbb'; +CREATE TABLE table_with_where (d DateTime, a Int) ENGINE = MergeTree ORDER BY d PARTITION BY toYYYYMM(d) TTL d + INTERVAL 1 MONTH DELETE WHERE toDayOfWeek(d) = 1; +CREATE TABLE table_for_recompression (d DateTime, key UInt64, value String) ENGINE = MergeTree() ORDER BY tuple() PARTITION BY key TTL d + INTERVAL 1 MONTH RECOMPRESS CODEC(ZSTD(17)), d + INTERVAL 1 YEAR RECOMPRESS CODEC(LZ4HC(10)) SETTINGS min_rows_for_wide_part=0, min_bytes_for_wide_part=0; diff --git a/parser/testdata/ddl/format/create_table_with_uuid.sql b/parser/testdata/ddl/format/create_table_with_uuid.sql index ec2e27b..b5f2141 100644 --- a/parser/testdata/ddl/format/create_table_with_uuid.sql +++ b/parser/testdata/ddl/format/create_table_with_uuid.sql @@ -14,4 +14,4 @@ PARTITION BY toYYYYMMDD(f3) ORDER BY (f0,f1,f2); -- Format SQL: -CREATE TABLE IF NOT EXISTS test.events_local UUID '1234' ON CLUSTER 'default_cluster' (f0 String, f1 String, f2 String, f3 Datetime, f4 Datetime, f5 Map(String, String), f6 String, f7 Datetime DEFAULT now()) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/test/events_local', '{replica}') PARTITION BY toYYYYMMDD(f3) TTL f3 + INTERVAL 6 MONTH ORDER BY (f0, f1, f2); +CREATE TABLE IF NOT EXISTS test.events_local UUID '1234' ON CLUSTER 'default_cluster' (f0 String, f1 String, f2 String, f3 Datetime, f4 Datetime, f5 Map(String, String), f6 String, f7 Datetime DEFAULT now()) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{layer}-{shard}/test/events_local', '{replica}') ORDER BY (f0, f1, f2) PARTITION BY toYYYYMMDD(f3) TTL f3 + INTERVAL 6 MONTH;