aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/compute_range/in2.sql
blob: 7ef922e9303896f4fa557db3bd45e7a252c31203 (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
/* syntax version 1 */
/* postgres can not */
/* dq can not */
/* dqfile can not */
/* yt can not */
pragma warning("disable", "4510");
pragma warning("disable", "1108");

-- tuple
select YQL::RangeComputeFor(
  Struct<x:UInt32, y:Uint32, z:Uint32>,
  ($row) -> (($row.y, $row.x, $row.z) IN ((1,2,3), (100,200,300))),
  AsTuple(AsAtom("x"), AsAtom("y"), AsAtom("z"))
);

-- tuple with single element
select YQL::RangeComputeFor(
  Struct<x:UInt32>,
  ($row) -> (($row.x,) IN ((1,), (100,))),
  AsTuple(AsAtom("x"))
);

-- key prefix tuples
select YQL::RangeComputeFor(
  Struct<x:UInt32, y:Uint32, z:Uint32>,
  ($row) -> (($row.y, $row.x) IN ((1,2), (2,2))),
  AsTuple(AsAtom("x"), AsAtom("y"), AsAtom("z"))
);