/tags/release-0.0.0-rc0/hive/external/ql/src/test/queries/clientnegative/union2.q
text | 13 lines | 10 code | 3 blank | 0 comment | 0 complexity | 735db3eda148c25fffc84b19146c0a85 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
- create table if not exists union2_t1(r string, c string, v string);
- create table if not exists union2_t2(s string, c string, v string);
- explain
- SELECT s.r, s.c, sum(s.v)
- FROM (
- SELECT a.r AS r, a.c AS c, a.v AS v FROM union2_t1 a
- UNION ALL
- SELECT b.s AS r, b.c AS c, 0 + b.v AS v FROM union2_t2 b
- ) s
- GROUP BY s.r, s.c;