PageRenderTime 859ms CodeModel.GetById 15ms RepoModel.GetById 2ms app.codeStats 0ms

/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
  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;