aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/select/dict_with_few_keys.sql
blob: b2a160161209cab77a80a18b8b66411390bcfe65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* syntax version 1 */
/* postgres can not */
USE plato;

$dict = (
SELECT
  AsDict(
    AsTuple("key", cast(key as uint32) ?? 0),
    AsTuple("sk", cast(subkey as uint32) ?? 1),
    AsTuple("str",  Cast(ByteAt(value, 0) as uint32) ?? 256)
  ) as dd
FROM Input);

--INSERT INTO Output
SELECT dd['key'] as key, dd['str'] as zz from $dict as d ORDER BY key, zz