-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prune row groups correctly for columns with the same name (#3802)
* test: add prune test case * fix: use latest region metadata to get column id * test: sort output
- Loading branch information
Showing
5 changed files
with
123 additions
and
18 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
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,67 @@ | ||
CREATE TABLE test(i TIMESTAMP TIME INDEX, j INTEGER, k INTEGER NOT NULL); | ||
|
||
Affected Rows: 0 | ||
|
||
INSERT INTO test(i, j, k) VALUES (1, 11, 5), (2, 12, 5); | ||
|
||
Affected Rows: 2 | ||
|
||
SELECT * FROM test order by i; | ||
|
||
+-------------------------+----+---+ | ||
| i | j | k | | ||
+-------------------------+----+---+ | ||
| 1970-01-01T00:00:00.001 | 11 | 5 | | ||
| 1970-01-01T00:00:00.002 | 12 | 5 | | ||
+-------------------------+----+---+ | ||
|
||
SELECT FLUSH_TABLE('test'); | ||
|
||
+---------------------------+ | ||
| flush_table(Utf8("test")) | | ||
+---------------------------+ | ||
| 0 | | ||
+---------------------------+ | ||
|
||
ALTER TABLE test DROP COLUMN j; | ||
|
||
Affected Rows: 0 | ||
|
||
ALTER TABLE test ADD COLUMN j INTEGER DEFAULT 0; | ||
|
||
Affected Rows: 0 | ||
|
||
INSERT INTO test(i, j, k) VALUES (3, 0, 6); | ||
|
||
Affected Rows: 1 | ||
|
||
INSERT INTO test VALUES (4, 7, 0); | ||
|
||
Affected Rows: 1 | ||
|
||
SELECT * FROM test order by i; | ||
|
||
+-------------------------+---+---+ | ||
| i | k | j | | ||
+-------------------------+---+---+ | ||
| 1970-01-01T00:00:00.001 | 5 | 0 | | ||
| 1970-01-01T00:00:00.002 | 5 | 0 | | ||
| 1970-01-01T00:00:00.003 | 6 | 0 | | ||
| 1970-01-01T00:00:00.004 | 7 | 0 | | ||
+-------------------------+---+---+ | ||
|
||
SELECT * FROM test WHERE j = 0 order by i; | ||
|
||
+-------------------------+---+---+ | ||
| i | k | j | | ||
+-------------------------+---+---+ | ||
| 1970-01-01T00:00:00.001 | 5 | 0 | | ||
| 1970-01-01T00:00:00.002 | 5 | 0 | | ||
| 1970-01-01T00:00:00.003 | 6 | 0 | | ||
| 1970-01-01T00:00:00.004 | 7 | 0 | | ||
+-------------------------+---+---+ | ||
|
||
DROP TABLE test; | ||
|
||
Affected Rows: 0 | ||
|
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 @@ | ||
CREATE TABLE test(i TIMESTAMP TIME INDEX, j INTEGER, k INTEGER NOT NULL); | ||
|
||
INSERT INTO test(i, j, k) VALUES (1, 11, 5), (2, 12, 5); | ||
|
||
SELECT * FROM test order by i; | ||
|
||
SELECT FLUSH_TABLE('test'); | ||
|
||
ALTER TABLE test DROP COLUMN j; | ||
|
||
ALTER TABLE test ADD COLUMN j INTEGER DEFAULT 0; | ||
|
||
INSERT INTO test(i, j, k) VALUES (3, 0, 6); | ||
|
||
INSERT INTO test VALUES (4, 7, 0); | ||
|
||
SELECT * FROM test order by i; | ||
|
||
SELECT * FROM test WHERE j = 0 order by i; | ||
|
||
DROP TABLE test; |