aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/expr/as_dict_tuple_key.sql
blob: 78c8bb39244ca4002b78c081adbbcee29573895b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* postgres can not */
$d = AsDict(
    AsTuple(AsTuple(),"foo"),
    AsTuple(AsTuple(),"bar")
);

select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
select DictLookup($d,AsTuple());
select DictContains($d,AsTuple());

$d = AsDict(
    AsTuple(AsTuple(1),"foo"),
    AsTuple(AsTuple(2),"bar")
);

select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
select DictLookup($d,AsTuple(1)),DictLookup($d,AsTuple(3));
select DictContains($d,AsTuple(1)),DictContains($d,AsTuple(3));

$d = AsDict(
    AsTuple(AsTuple(1,2),"foo"),
    AsTuple(AsTuple(1,3),"bar")
);

select ListSort(DictItems($d)),ListSort(DictKeys($d)),ListSort(DictPayloads($d));
select DictLookup($d,AsTuple(1,2)),DictLookup($d,AsTuple(1,4));
select DictContains($d,AsTuple(1,2)),DictContains($d,AsTuple(1,4));