-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support alter table add roll up in shard data
Signed-off-by: smartlxh <[email protected]>
- Loading branch information
Showing
5 changed files
with
70 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-- name: test_lake_rollup @cloud | ||
CREATE TABLE tbl1 ( | ||
k1 date, | ||
k2 int, | ||
v1 int sum | ||
) PARTITION BY RANGE(k1) ( | ||
PARTITION p1 values [('2020-01-01'),('2020-02-01')), | ||
PARTITION p2 values [('2020-02-01'),('2020-03-01'))) | ||
DISTRIBUTED BY HASH(k2) BUCKETS 3 | ||
PROPERTIES('replication_num' = '1'); | ||
-- result: | ||
-- !result | ||
|
||
INSERT INTO tbl1 | ||
VALUES | ||
("2020-01-12",4,100), | ||
("2020-01-11",5,100), | ||
("2020-01-11",4,100); | ||
-- result: | ||
-- !result | ||
|
||
ALTER TABLE tbl1 ADD ROLLUP rollup1 (k1, v1) FROM tbl1; | ||
-- result: | ||
-- !result | ||
function: wait_alter_table_finish("ROLLUP") | ||
-- result: | ||
None | ||
-- !result | ||
|
||
INSERT INTO tbl1 VALUES("2020-01-11",6,100); | ||
-- result: | ||
-- !result |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- name: test_lake_rollup @cloud | ||
CREATE TABLE tbl1 ( | ||
k1 date, | ||
k2 int, | ||
v1 int sum | ||
) PARTITION BY RANGE(k1) ( | ||
PARTITION p1 values [('2020-01-01'),('2020-02-01')), | ||
PARTITION p2 values [('2020-02-01'),('2020-03-01'))) | ||
DISTRIBUTED BY HASH(k2) BUCKETS 3 | ||
PROPERTIES('replication_num' = '1'); | ||
|
||
INSERT INTO tbl1 | ||
VALUES | ||
("2020-01-12",4,100), | ||
("2020-01-11",5,100), | ||
("2020-01-11",4,100); | ||
|
||
ALTER TABLE tbl1 ADD ROLLUP rollup1 (k1, v1) FROM tbl1; | ||
function: wait_alter_table_finish("ROLLUP") | ||
|
||
INSERT INTO tbl1 VALUES("2020-01-11",6,100); |
This file contains 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
This file contains 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