-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
272 additions
and
0 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
File renamed without changes.
41 changes: 41 additions & 0 deletions
41
tests/sqllogictests/suites/query/functions/02_0074_function_map.test
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,41 @@ | ||
statement ok | ||
DROP DATABASE IF EXISTS map_func_test | ||
|
||
statement ok | ||
CREATE DATABASE IF NOT EXISTS map_func_test | ||
|
||
statement ok | ||
USE map_func_test | ||
|
||
query TT | ||
select map_keys({}), map_values({}) | ||
---- | ||
[] [] | ||
|
||
query TT | ||
select map_keys({'k1':1,'k2':2,'k3':null}), map_values({'k1':1,'k2':2,'k3':null}) | ||
---- | ||
['k1','k2','k3'] [1,2,NULL] | ||
|
||
statement ok | ||
create table t(col1 Map(String, String Null) Not Null, col2 Map(String, Int Null) Null) | ||
|
||
statement ok | ||
insert into t values({'k1':'v1','k2':'v2','k3':null},{'a':10,'b':20}), ({'k5':'v5','k6':'v6'}, {'d':40,'e':null,'f':50}), ({}, null) | ||
|
||
query TT | ||
select map_keys(col1), map_keys(col2) from t | ||
---- | ||
['k1','k2','k3'] ['a','b'] | ||
['k5','k6'] ['d','e','f'] | ||
[] NULL | ||
|
||
query TT | ||
select map_values(col1), map_values(col2) from t | ||
---- | ||
['v1','v2',NULL] [10,20] | ||
['v5','v6'] [40,NULL,50] | ||
[] NULL | ||
|
||
statement ok | ||
DROP DATABASE map_func_test |