aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/lineage/flatten_by.sql
blob: 16bc737177bbe6a3c65d747c6d2e59a85d119b4f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use plato;

$subquery1 =
SELECT
key, subkey, z
FROM Input
FLATTEN LIST BY value as z;

$subquery2 =
SELECT
key, subkey, value as z, value2
FROM Input
FLATTEN LIST BY (value, value2);

INSERT INTO @tmp1 WITH TRUNCATE
SELECT *
FROM $subquery1;

INSERT INTO @tmp2 WITH TRUNCATE
SELECT *
FROM $subquery2;