-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(common): fix memcomparable encoding for list (#4599)
* add has_remaining * fix list_array * fix serialize * better error message * enable order by test for struct/list * add e2e tests * remove has_fixed_length sincei it is not needed Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b37d329
commit bb66ea8
Showing
8 changed files
with
375 additions
and
234 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
statement ok | ||
create table t (a int[]); | ||
|
||
statement ok | ||
insert into t values (array[1]), (array[2]), (array[1, 2, 3]), (NULL), (array[1, NULL]); | ||
|
||
query T | ||
select * from t order by 1; | ||
---- | ||
{1} | ||
{1,2,3} | ||
{1,NULL} | ||
{2} | ||
NULL | ||
|
||
statement ok | ||
drop table t; | ||
|
||
statement ok | ||
create table t (a int[][]); | ||
|
||
statement ok | ||
insert into t values (array[array[1, 2, 3], array[2]]), (array[array[1], array[2, 3, 2]]), (array[array[2], array[1]]); | ||
|
||
query T | ||
select * from t order by 1; | ||
---- | ||
{{1},{2,3,2}} | ||
{{1,2,3},{2}} | ||
{{2},{1}} | ||
|
||
statement ok | ||
drop table t; | ||
|
||
statement ok | ||
create table t (a int[], b int); | ||
|
||
statement ok | ||
insert into t values (array[1, 2], 3), (array[1], NULL), (array[1], 3), (array[2], 1); | ||
|
||
query TI | ||
select * from t order by 1 ASC, 2 DESC; | ||
---- | ||
{1} NULL | ||
{1} 3 | ||
{1,2} 3 | ||
{2} 1 | ||
|
||
statement ok | ||
drop table t; | ||
|
||
statement ok | ||
create table t (a varchar[][]); | ||
|
||
statement ok | ||
insert into t values (array[array['abc', 'd'], array['ef']]), (array[array['a', 'bcd'], array['e', 'f']]), (array[array['abc', 'd'], array['e', 'f']]), (array[array['b'], array['c']]); | ||
|
||
query T | ||
select * from t order by 1 DESC; | ||
---- | ||
{{b},{c}} | ||
{{abc,d},{ef}} | ||
{{abc,d},{e,f}} | ||
{{a,bcd},{e,f}} | ||
|
||
statement ok | ||
drop table t; |
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,38 @@ | ||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
statement ok | ||
create table t (a struct<v1 int, v2 int>); | ||
|
||
statement ok | ||
insert into t values ((1, 2)), ((1, 3)), ((1, NULL)), ((2, 1)), ((2, 2)), ((NULL, NULL)); | ||
|
||
query II | ||
select * from t order by 1; | ||
---- | ||
(1,2) | ||
(1,3) | ||
(1,NULL) | ||
(2,1) | ||
(2,2) | ||
(NULL,NULL) | ||
|
||
statement ok | ||
drop table t; | ||
|
||
statement ok | ||
create table t (v1 struct<v1 varchar, v2 struct<v1 varchar, v2 int> >, v2 int); | ||
|
||
statement ok | ||
insert into t values (('abc',('bcd',2)),1), (('abc',('bcd',2)),2), (('a',('bcbcd',2)),2), (('b',('a',2)),2); | ||
|
||
query TTII | ||
select * from t order by 1 DESC, 2 ASC; | ||
---- | ||
(b,(a,2)) 2 | ||
(abc,(bcd,2)) 1 | ||
(abc,(bcd,2)) 2 | ||
(a,(bcbcd,2)) 2 | ||
|
||
statement ok | ||
drop table t; |
Oops, something went wrong.