-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic e2e with casting from and into string
- Loading branch information
1 parent
7488dd9
commit 7c16d15
Showing
8 changed files
with
120 additions
and
12 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,37 @@ | ||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
query T rowsort | ||
values ('{"a":[2, true, "", {}]}'::jsonb), ('1'), ('true'), ('null'), (null), ('[1, true]'); | ||
---- | ||
1 | ||
NULL | ||
[1,true] | ||
null | ||
true | ||
{"a":[2,true,"",{}]} | ||
|
||
statement ok | ||
create table t (v1 jsonb); | ||
|
||
statement ok | ||
insert into t values ('1'), ('true'), ('null'), (null); | ||
|
||
query T rowsort | ||
select * from t; | ||
---- | ||
1 | ||
NULL | ||
null | ||
true | ||
|
||
query T | ||
select * from t order by v1::varchar; | ||
---- | ||
1 | ||
null | ||
true | ||
NULL | ||
|
||
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,44 @@ | ||
# We do not intend to support using `jsonb` type for `group by` / `order by` / `primary key` | ||
# Before #7981 is done, we need these tests to make sure our system do not panic. | ||
# After #7981, we need them to make sure proper errors are returned to user. | ||
|
||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
statement ok | ||
values ('{"a":[2, true, "", {}]}'::jsonb), ('1'), ('true'), ('null'), (null), ('[1, true]') order by 1; | ||
|
||
statement ok | ||
create table t (v1 jsonb); | ||
|
||
statement ok | ||
insert into t values ('1'), ('true'), ('null'), (null); | ||
|
||
statement ok | ||
select * from t order by v1; | ||
|
||
# deserialize length | ||
statement ok | ||
create materialized view mv1 as select * from t group by v1; | ||
|
||
statement ok | ||
select * from mv1; | ||
|
||
statement ok | ||
drop materialized view mv1; | ||
|
||
# deserialize pk | ||
statement ok | ||
create table t2 (v1 jsonb primary key); | ||
|
||
statement ok | ||
insert into t2 values ('1'), ('true'), ('null'), (null); | ||
|
||
statement ok | ||
select * from t2; | ||
|
||
statement ok | ||
drop table t2; | ||
|
||
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
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