aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/aggregate/fail_group_by_struct_member.sqlx
blob: 0dc3a1ee82fe9210f06e52564319627c620dead7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* postgres can not */
$input = (
  SELECT AsStruct("a" AS value) AS s, "1" AS value
  UNION ALL
  SELECT AsStruct("b" AS value) AS s, "2" AS value
  UNION ALL
  SELECT AsStruct("c" AS value) AS s, "3" AS value
  UNION ALL
  SELECT AsStruct("b" AS value) AS s, "1" AS value
  UNION ALL
  SELECT AsStruct("b" AS value) AS s, "2" AS value
  UNION ALL
  SELECT AsStruct("a" AS value) AS s, "3" AS value
);

SELECT count(*) FROM $input GROUP BY s.value;