aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/join/flatten_columns2.sql
blob: 9ae2d879e42bffd6111735acff189a10d3764f23 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
PRAGMA DisableSimpleColumns;
/* postgres can not */
USE plato;

SELECT * FROM (
SELECT
    AsStruct(key as key, subkey as subkey),
    AsStruct("value1: " || value as value)
FROM Input1
) as a
FLATTEN COLUMNS
JOIN (
SELECT
    AsStruct(key as key, subkey as subkey),
    AsStruct("value2: " || value as value)
FROM Input2
) as b
FLATTEN COLUMNS
USING (key)
ORDER BY a.key;