-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support create table with map type
- Loading branch information
Showing
13 changed files
with
130 additions
and
38 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 was deleted.
Oops, something went wrong.
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,57 @@ | ||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
|
||
statement error | ||
create table t (m map (float, float)); | ||
---- | ||
db error: ERROR: Failed to run the query | ||
|
||
Caused by: | ||
invalid map key type: double precision | ||
|
||
|
||
statement ok | ||
create table t ( | ||
m1 map(varchar, float), | ||
m2 map(int, bool), | ||
m3 map(varchar, map(varchar, varchar)), | ||
l map(varchar,int)[], | ||
s struct<m map(varchar, struct<x int>)>, | ||
); | ||
|
||
|
||
statement ok | ||
insert into t values ( | ||
map_from_entries(array['a','b','c'], array[1.0,2.0,3.0]::float[]), | ||
map_from_entries(array[1,2,3], array[true,false,true]), | ||
map_from_entries(array['a','b'], | ||
array[ | ||
map_from_entries(array['a1'], array['a2']), | ||
map_from_entries(array['b1'], array['b2']) | ||
] | ||
), | ||
array[ | ||
map_from_entries(array['a','b','c'], array[1,2,3]), | ||
map_from_entries(array['d','e','f'], array[4,5,6]) | ||
], | ||
row( | ||
map_from_entries(array['a','b','c'], array[row(1),row(2),row(3)]::struct<x int>[]) | ||
) | ||
); | ||
|
||
query ????? | ||
select * from t; | ||
---- | ||
{"a":1,"b":2,"c":3} {"1":t,"2":f,"3":t} {"a":{"a1":a2},"b":{"b1":b2}} {"{\"a\":1,\"b\":2,\"c\":3}","{\"d\":4,\"e\":5,\"f\":6}"} ("{""a"":(1),""b"":(2),""c"":(3)}") | ||
|
||
|
||
# FIXME: The cast should be supported | ||
statement error | ||
insert into t(m1) values (map_from_entries(array['a','b','c'], array[1,2,3])); | ||
---- | ||
db error: ERROR: Failed to run the query | ||
|
||
Caused by these errors (recent errors listed first): | ||
1: failed to cast the 1st column | ||
2: cannot cast type "map(character varying,integer)" to "map(character varying,double precision)" in Assign context |
This file was deleted.
Oops, something went wrong.
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
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