aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/compute_range/yql-12941.sql
blob: 63e2a586bc4ed23d6e929a69a540b75598ba5231 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* syntax version 1 */
/* postgres can not */
/* yt can not */

pragma warning("disable", "4510");

$opt_type = Struct<x:UInt32?, y:Int32?>;
$xy_keys = AsTuple(AsAtom("x"), AsAtom("y"));

$range_for = ($pred) -> (YQL::RangeComputeFor($opt_type, $pred, $xy_keys));

$pred1 = ($row) -> (($row.x == 3u and ($row.y > 300 or $row.y == 100)) ?? false);
$pred2 = ($row) -> (($row.y > 300 and $row.x == 3u or $row.x == 3u and $row.y == 100) ?? false);


select
   $range_for($pred1),
   $range_for($pred2),
;