aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/join/convert_check_key_mem.sql
blob: 5902507e2f910ccc5368144185c07669260fdbb5 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
PRAGMA DisableSimpleColumns;
/* postgres can not */

$a = AsList(
    AsStruct(255ut AS K, 1 AS V),
    AsStruct(127ut AS K, 2 AS V),
    AsStruct(0ut   AS K, 3 AS V));

$b = AsList(
    AsStruct(Int8("-1")  AS K, 1u AS V),
    AsStruct(Int8("127") AS K, 2u AS V),
    AsStruct(Int8("0")   AS K, 3u AS V));

$aopt = AsList(
    AsStruct(Just(255ut) AS K, 1 AS V),
    AsStruct(Just(127ut) AS K, 2 AS V),
    AsStruct(Just(0ut)   AS K, 3 AS V),
    AsStruct(Nothing(ParseType("Uint8?")) AS K, 2 AS V));

$bopt = AsList(
    AsStruct(Just(Int8("-1"))  AS K, 1u AS V),
    AsStruct(Just(Int8("127")) AS K, 2u AS V),
    AsStruct(Just(Int8("0"))   AS K, 3u AS V),
    AsStruct(Nothing(ParseType("Int8?")) AS K, 2u AS V));

select a.K, b.V from as_table($a) as a
  join as_table($b) as b on a.K = b.K and a.V = b.V
order by a.K, b.V;

select a.K, b.V from as_table($aopt) as a
  join as_table($b) as b on a.K = b.K and a.V = b.V
order by a.K, b.V;

select a.K, b.V from as_table($a) as a
  join as_table($bopt) as b on a.K = b.K and a.V = b.V
order by a.K, b.V;

select a.K, b.V from as_table($aopt) as a
  join as_table($bopt) as b on a.K = b.K and a.V = b.V
order by a.K, b.V;