aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/blocks/agg_with_optional_string_keys.sql
blob: 85b11d3abef9a58216f98301870bffbc57a6e1e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
pragma config.flags("PeepholeFlags","UseAggPhases");

$src = ListMap(ListFromRange(cast (0 as Int64), cast(500 as Int64)), ($x) -> {
    return <|
        k: if ($x % 10 == 0, NULL, cast ($x as String)),
        v: $x
    |>;
});

select k, sum(v) as s from as_table($src) group by k order by k, s;