Skip to content

Instantly share code, notes, and snippets.

@alexey-milovidov
Created June 21, 2016 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexey-milovidov/71c61a63aeca4b0da8ba2c2298315e1d to your computer and use it in GitHub Desktop.
Save alexey-milovidov/71c61a63aeca4b0da8ba2c2298315e1d to your computer and use it in GitHub Desktop.
Check for constants in primary key.
$ clickhouse-client
ClickHouse client version 0.0.53720.
Connecting to localhost:9000.
Connected to ClickHouse server version 1.1.53981.
:) create table hoba (naber Date) ENGINE = MergeTree(naber, (1, naber), 8192)
CREATE TABLE hoba
(
naber Date
) ENGINE = MergeTree(naber, (1, naber), 8192)
Received exception from server:
Code: 44. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception: Primary key cannot contain constants.
0 rows in set. Elapsed: 0.052 sec.
:) create table hoba (naber Date) ENGINE = MergeTree(naber, (naber, naber + 1), 8192)
CREATE TABLE hoba
(
naber Date
) ENGINE = MergeTree(naber, (naber, naber + 1), 8192)
Ok.
0 rows in set. Elapsed: 0.003 sec.
:)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment