aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/produce/reduce_by_struct.sql
blob: a36223f7a4bb55bb07d07c177f3624cec4503c45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
USE plato;

INSERT INTO @tmp
SELECT * FROM AS_TABLE([
	    <|key: <|field1: 1, field2: 1|>, value: 1|>,
	    <|key: <|field1: 1, field2: 1|>, value: 2|>,
	]);

COMMIT;

$reducer = ($_key, $stream) -> ($stream);

REDUCE @tmp
ON key
USING $reducer(TableRow());