Created
October 24, 2017 15:45
-
-
Save chaudum/b1774afdbe5c03067bd967d3c9cb1730 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE t_a ( | |
ts TIMESTAMP, | |
hash STRING, | |
granularity STRING, | |
value FLOAT, | |
part_key__generated TIMESTAMP GENERATED ALWAYS AS date_trunc(granularity, ts) | |
) PARTITIONED BY (granularity, part_key__generated); | |
INSERT INTO t_a (ts, hash, granularity, value) VALUES (1508848674000, 'abc', 'day', 0.1); | |
CREATE TABLE t_b ( | |
ts TIMESTAMP, | |
hash STRING, | |
granularity STRING, | |
value FLOAT, | |
part_key__generated TIMESTAMP GENERATED ALWAYS AS date_trunc(granularity, ts), | |
PRIMARY KEY (ts, hash, granularity, part_key__generated) | |
) PARTITIONED BY (granularity, part_key__generated); | |
INSERT INTO t_b (ts, hash, granularity, value) VALUES (1508848674000, 'abc', 'day', 0.1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ crash --hosts st1.p.fir.io:4200 < test.sql | |
CONNECT OK | |
CREATE OK, 1 row affected (0.048 sec) | |
INSERT OK, 1 row affected (1.006 sec) | |
CREATE OK, 1 row affected (0.049 sec) | |
SQLActionException[SQLParseException: Primary key value must not be NULL] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment