/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

  1. create table if not exists union2_t1(r string, c string, v string);
  2. create table if not exists union2_t2(s string, c string, v string);
  3. explain
  4. SELECT s.r, s.c, sum(s.v)
  5. FROM (
  6. SELECT a.r AS r, a.c AS c, a.v AS v FROM union2_t1 a
  7. UNION ALL
  8. SELECT b.s AS r, b.c AS c, 0 + b.v AS v FROM union2_t2 b
  9. ) s
  10. GROUP BY s.r, s.c;