You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/main/sphinx/connector/clickhouse.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,13 +154,13 @@ WITH (
154
154
155
155
The following are supported ClickHouse table properties from [https://clickhouse.tech/docs/en/engines/table-engines/mergetree-family/mergetree/](https://clickhouse.tech/docs/en/engines/table-engines/mergetree-family/mergetree/)
|`engine`|`Log`| Name and parameters of the engine. |
160
+
|`order_by`| (none) | Array of columns or expressions to concatenate to create the sorting key. `tuple()` is used by default if `order_by is` not specified.|
161
+
|`partition_by`| (none) | Array of columns or expressions to use as nested partition keys. Optional. |
162
+
|`primary_key`| (none) | Array of columns or expressions to concatenate to create the primary key. Optional. |
163
+
|`sample_by`| (none) | An expression to use for [sampling](https://clickhouse.tech/docs/en/sql-reference/statements/select/sample/). Optional. |
164
164
165
165
Currently the connector only supports `Log` and `MergeTree` table engines
166
166
in create table statement. `ReplicatedMergeTree` engine is not yet supported.
assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree')", "The property of order_by is required for table engine MergeTree\\(\\)");
358
+
assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree')");
assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR, logdate DATE NOT NULL) WITH " +
@@ -373,7 +375,7 @@ public void testDifferentEngine()
373
375
374
376
//NOT support engine
375
377
assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'bad_engine')",
376
-
"line 1:76: Unable to set catalog 'clickhouse' table property 'engine' to.*");
378
+
".* Unable to set catalog 'clickhouse' table property 'engine' to.*");
377
379
}
378
380
379
381
@Test
@@ -509,15 +511,15 @@ public void testTableProperty()
509
511
510
512
// Primary key must be a prefix of the sorting key,
511
513
assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x boolean NOT NULL, y boolean NOT NULL) WITH (engine = 'MergeTree', order_by = ARRAY['id'], sample_by = ARRAY['x', 'y'])",
512
-
"line 1:151: Invalid value for catalog 'clickhouse' table property 'sample_by': .*");
514
+
".* Invalid value for catalog 'clickhouse' table property 'sample_by': .*");
513
515
514
516
// wrong property type
515
517
assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL) WITH (engine = 'MergeTree', order_by = 'id')",
516
-
"line 1:87: Invalid value for catalog 'clickhouse' table property 'order_by': .*");
518
+
".* Invalid value for catalog 'clickhouse' table property 'order_by': .*");
517
519
assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL) WITH (engine = 'MergeTree', order_by = ARRAY['id'], primary_key = 'id')",
518
-
"line 1:111: Invalid value for catalog 'clickhouse' table property 'primary_key': .*");
520
+
".* Invalid value for catalog 'clickhouse' table property 'primary_key': .*");
519
521
assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL) WITH (engine = 'MergeTree', order_by = ARRAY['id'], primary_key = ARRAY['id'], partition_by = 'id')",
520
-
"line 1:138: Invalid value for catalog 'clickhouse' table property 'partition_by': .*");
522
+
".* Invalid value for catalog 'clickhouse' table property 'partition_by': .*");
0 commit comments