hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpull...@apache.org
Subject svn commit: r1658489 [6/6] - in /hive/trunk: itests/src/test/resources/ ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ ql/src/java/org/apache/hadoop/hive/ql/parse/ ql/src/test/queries/clientnegative/ ql/src/test/queries/clientposit...
Date Mon, 09 Feb 2015 18:07:03 GMT
Added: hive/trunk/ql/src/test/results/clientpositive/unionDistinct_2.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/unionDistinct_2.q.out?rev=1658489&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/unionDistinct_2.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/unionDistinct_2.q.out Mon Feb  9 18:07:01
2015
@@ -0,0 +1,541 @@
+PREHOOK: query: CREATE TABLE u1 as select key, value from src order by key limit 5
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src
+PREHOOK: Output: database:default
+PREHOOK: Output: default@u1
+POSTHOOK: query: CREATE TABLE u1 as select key, value from src order by key limit 5
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@u1
+PREHOOK: query: CREATE TABLE u2 as select key, value from src order by key limit 3
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src
+PREHOOK: Output: database:default
+PREHOOK: Output: default@u2
+POSTHOOK: query: CREATE TABLE u2 as select key, value from src order by key limit 3
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@u2
+PREHOOK: query: CREATE TABLE u3 as select key, value from src order by key desc limit 5
+PREHOOK: type: CREATETABLE_AS_SELECT
+PREHOOK: Input: default@src
+PREHOOK: Output: database:default
+PREHOOK: Output: default@u3
+POSTHOOK: query: CREATE TABLE u3 as select key, value from src order by key desc limit 5
+POSTHOOK: type: CREATETABLE_AS_SELECT
+POSTHOOK: Input: default@src
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@u3
+PREHOOK: query: select * from u1
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+#### A masked pattern was here ####
+POSTHOOK: query: select * from u1
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+#### A masked pattern was here ####
+0	val_0
+0	val_0
+0	val_0
+10	val_10
+100	val_100
+PREHOOK: query: select * from u2
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u2
+#### A masked pattern was here ####
+POSTHOOK: query: select * from u2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u2
+#### A masked pattern was here ####
+0	val_0
+0	val_0
+0	val_0
+PREHOOK: query: select * from u3
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select * from u3
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+98	val_98
+98	val_98
+97	val_97
+97	val_97
+96	val_96
+PREHOOK: query: select key, value from 
+(
+select key, value from u1
+union all
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value from 
+(
+select key, value from u1
+union all
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+98	val_98
+98	val_98
+97	val_97
+97	val_97
+96	val_96
+0	val_0
+0	val_0
+0	val_0
+10	val_10
+100	val_100
+0	val_0
+0	val_0
+0	val_0
+PREHOOK: query: select key, value from 
+(
+select key, value from u1
+union 
+select key, value from u2
+union all
+select key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value from 
+(
+select key, value from u1
+union 
+select key, value from u2
+union all
+select key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+98	val_98
+98	val_98
+97	val_97
+97	val_97
+96	val_96
+PREHOOK: query: select key, value from 
+(
+select key, value from u1
+union distinct
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value from 
+(
+select key, value from u1
+union distinct
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+98	val_98
+98	val_98
+97	val_97
+97	val_97
+96	val_96
+PREHOOK: query: select key, value from 
+(
+select key, value from u1
+union all
+select key, value from u2
+union
+select key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value from 
+(
+select key, value from u1
+union all
+select key, value from u2
+union
+select key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98
+PREHOOK: query: select key, value from 
+(
+select key, value from u1
+union 
+select key, value from u2
+union
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select key, value from 
+(
+select key, value from u1
+union 
+select key, value from u2
+union
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98
+PREHOOK: query: select distinct * from 
+(
+select key, value from u1
+union all 
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select distinct * from 
+(
+select key, value from u1
+union all 
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98
+PREHOOK: query: select distinct * from 
+(
+select distinct * from u1
+union  
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select distinct * from 
+(
+select distinct * from u1
+union  
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98
+PREHOOK: query: drop view if exists v
+PREHOOK: type: DROPVIEW
+POSTHOOK: query: drop view if exists v
+POSTHOOK: type: DROPVIEW
+PREHOOK: query: create view v as select distinct * from 
+(
+select distinct * from u1
+union  
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+PREHOOK: Output: database:default
+PREHOOK: Output: default@v
+POSTHOOK: query: create view v as select distinct * from 
+(
+select distinct * from u1
+union  
+select key, value from u2
+union all
+select key as key, value from u3
+) tab
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@v
+PREHOOK: query: describe extended v
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@v
+POSTHOOK: query: describe extended v
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@v
+key                 	string              	                    
+value               	string              	                    
+	 	 
+#### A masked pattern was here ####
+(	 	 
+select distinct * from u1	 	 
+union  	 	 
+select key, value from u2	 	 
+union all	 	 
+select key as key, value from u3	 	 
+) tab, viewExpandedText:select distinct `tab`.`key`, `tab`.`value` from 	 	 
+(	 	 
+select distinct `u1`.`key`, `u1`.`value` from `default`.`u1`	 	 
+union  	 	 
+select `u2`.`key`, `u2`.`value` from `default`.`u2`	 	 
+union all	 	 
+select `u3`.`key` as `key`, `u3`.`value` from `default`.`u3`	 	 
+) `tab`, tableType:VIRTUAL_VIEW)		 
+PREHOOK: query: select * from v
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+PREHOOK: Input: default@v
+#### A masked pattern was here ####
+POSTHOOK: query: select * from v
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+POSTHOOK: Input: default@v
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98
+PREHOOK: query: drop view if exists v
+PREHOOK: type: DROPVIEW
+PREHOOK: Input: default@v
+PREHOOK: Output: default@v
+POSTHOOK: query: drop view if exists v
+POSTHOOK: type: DROPVIEW
+POSTHOOK: Input: default@v
+POSTHOOK: Output: default@v
+PREHOOK: query: create view v as select tab.* from 
+(
+select distinct * from u1
+union  
+select distinct * from u2
+) tab
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@v
+POSTHOOK: query: create view v as select tab.* from 
+(
+select distinct * from u1
+union  
+select distinct * from u2
+) tab
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@v
+PREHOOK: query: describe extended v
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@v
+POSTHOOK: query: describe extended v
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@v
+key                 	string              	                    
+value               	string              	                    
+	 	 
+#### A masked pattern was here ####
+(	 	 
+select distinct * from u1	 	 
+union  	 	 
+select distinct * from u2	 	 
+) tab, viewExpandedText:select `tab`.`key`, `tab`.`value` from 	 	 
+(	 	 
+select distinct `u1`.`key`, `u1`.`value` from `default`.`u1`	 	 
+union  	 	 
+select distinct `u2`.`key`, `u2`.`value` from `default`.`u2`	 	 
+) `tab`, tableType:VIRTUAL_VIEW)		 
+PREHOOK: query: select * from v
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@v
+#### A masked pattern was here ####
+POSTHOOK: query: select * from v
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@v
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+PREHOOK: query: drop view if exists v
+PREHOOK: type: DROPVIEW
+PREHOOK: Input: default@v
+PREHOOK: Output: default@v
+POSTHOOK: query: drop view if exists v
+POSTHOOK: type: DROPVIEW
+POSTHOOK: Input: default@v
+POSTHOOK: Output: default@v
+PREHOOK: query: create view v as select * from 
+(
+select distinct u1.* from u1
+union all 
+select distinct * from u2
+) tab
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@v
+POSTHOOK: query: create view v as select * from 
+(
+select distinct u1.* from u1
+union all 
+select distinct * from u2
+) tab
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@v
+PREHOOK: query: describe extended v
+PREHOOK: type: DESCTABLE
+PREHOOK: Input: default@v
+POSTHOOK: query: describe extended v
+POSTHOOK: type: DESCTABLE
+POSTHOOK: Input: default@v
+key                 	string              	                    
+value               	string              	                    
+	 	 
+#### A masked pattern was here ####
+(	 	 
+select distinct u1.* from u1	 	 
+union all 	 	 
+select distinct * from u2	 	 
+) tab, viewExpandedText:select `tab`.`key`, `tab`.`value` from 	 	 
+(	 	 
+select distinct `u1`.`key`, `u1`.`value` from `default`.`u1`	 	 
+union all 	 	 
+select distinct `u2`.`key`, `u2`.`value` from `default`.`u2`	 	 
+) `tab`, tableType:VIRTUAL_VIEW)		 
+PREHOOK: query: select * from v
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@v
+#### A masked pattern was here ####
+POSTHOOK: query: select * from v
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@v
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+0	val_0
+PREHOOK: query: select distinct * from 
+(
+select key, value from u1
+union all 
+select key, value from u2
+union 
+select key as key, value from u3
+) tab
+PREHOOK: type: QUERY
+PREHOOK: Input: default@u1
+PREHOOK: Input: default@u2
+PREHOOK: Input: default@u3
+#### A masked pattern was here ####
+POSTHOOK: query: select distinct * from 
+(
+select key, value from u1
+union all 
+select key, value from u2
+union 
+select key as key, value from u3
+) tab
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@u1
+POSTHOOK: Input: default@u2
+POSTHOOK: Input: default@u3
+#### A masked pattern was here ####
+0	val_0
+10	val_10
+100	val_100
+96	val_96
+97	val_97
+98	val_98

Modified: hive/trunk/ql/src/test/results/clientpositive/union_null.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union_null.q.out?rev=1658489&r1=1658488&r2=1658489&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union_null.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union_null.q.out Mon Feb  9 18:07:01 2015
@@ -1,14 +1,14 @@
 PREHOOK: query: -- SORT_BEFORE_DIFF
 
 -- HIVE-2901
-select x from (select value as x from src order by x limit 5 union all select NULL as x from
src limit 5) a
+select x from (select * from (select value as x from src order by x limit 5)a union all select
* from (select NULL as x from src limit 5)b )a
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 #### A masked pattern was here ####
 POSTHOOK: query: -- SORT_BEFORE_DIFF
 
 -- HIVE-2901
-select x from (select value as x from src order by x limit 5 union all select NULL as x from
src limit 5) a
+select x from (select * from (select value as x from src order by x limit 5)a union all select
* from (select NULL as x from src limit 5)b )a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
@@ -23,12 +23,12 @@ NULL
 NULL
 NULL
 PREHOOK: query: -- HIVE-4837
-select * from (select null as N from src1 group by key UNION ALL select null as N from src1
group by key ) a
+select * from (select * from (select null as N from src1 group by key)a UNION ALL select
* from (select null as N from src1 group by key)b ) a
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src1
 #### A masked pattern was here ####
 POSTHOOK: query: -- HIVE-4837
-select * from (select null as N from src1 group by key UNION ALL select null as N from src1
group by key ) a
+select * from (select * from (select null as N from src1 group by key)a UNION ALL select
* from (select null as N from src1 group by key)b ) a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src1
 #### A masked pattern was here ####

Modified: hive/trunk/ql/src/test/results/clientpositive/union_ppr.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union_ppr.q.out?rev=1658489&r1=1658488&r2=1658489&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union_ppr.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union_ppr.q.out Mon Feb  9 18:07:01 2015
@@ -25,7 +25,7 @@ ABSTRACT SYNTAX TREE:
 TOK_QUERY
    TOK_FROM
       TOK_SUBQUERY
-         TOK_UNION
+         TOK_UNIONALL
             TOK_QUERY
                TOK_FROM
                   TOK_TABREF

Modified: hive/trunk/ql/src/test/results/clientpositive/union_remove_25.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union_remove_25.q.out?rev=1658489&r1=1658488&r2=1658489&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union_remove_25.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union_remove_25.q.out Mon Feb  9 18:07:01
2015
@@ -257,18 +257,18 @@ PREHOOK: query: explain
 insert overwrite table outputTbl2 partition(ds)
 SELECT *
 FROM (
-  SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500
+  select * from (SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500)a
   UNION ALL
-  SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500
+  select * from (SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500)b
 ) a
 PREHOOK: type: QUERY
 POSTHOOK: query: explain 
 insert overwrite table outputTbl2 partition(ds)
 SELECT *
 FROM (
-  SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500
+  select * from (SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500)a
   UNION ALL
-  SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500
+  select * from (SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500)b
 ) a
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
@@ -368,9 +368,9 @@ STAGE PLANS:
 PREHOOK: query: insert overwrite table outputTbl2 partition(ds)
 SELECT *
 FROM (
-  SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500
+  select * from (SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500)a
   UNION ALL
-  SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500
+  select * from (SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500)b
 ) a
 PREHOOK: type: QUERY
 PREHOOK: Input: default@srcpart
@@ -380,9 +380,9 @@ PREHOOK: Output: default@outputtbl2
 POSTHOOK: query: insert overwrite table outputTbl2 partition(ds)
 SELECT *
 FROM (
-  SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500
+  select * from (SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500)a
   UNION ALL
-  SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500
+  select * from (SELECT key, value, ds from srcpart where ds='2008-04-08' limit 500)b
 ) a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@srcpart
@@ -442,17 +442,17 @@ Storage Desc Params:
 PREHOOK: query: explain insert overwrite table outputTbl3 partition(ds, hr)
 SELECT *
 FROM (
-  SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000
+  select * from (SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000)a
   UNION ALL
-  SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000
+  select * from (SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000)b
 ) a
 PREHOOK: type: QUERY
 POSTHOOK: query: explain insert overwrite table outputTbl3 partition(ds, hr)
 SELECT *
 FROM (
-  SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000
+  select * from (SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000)a
   UNION ALL
-  SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000
+  select * from (SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000)b
 ) a
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
@@ -553,9 +553,9 @@ STAGE PLANS:
 PREHOOK: query: insert overwrite table outputTbl3 partition(ds, hr)
 SELECT *
 FROM (
-  SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000
+  select * from (SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000)a
   UNION ALL
-  SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000
+  select * from (SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000)b
 ) a
 PREHOOK: type: QUERY
 PREHOOK: Input: default@srcpart
@@ -565,9 +565,9 @@ PREHOOK: Output: default@outputtbl3
 POSTHOOK: query: insert overwrite table outputTbl3 partition(ds, hr)
 SELECT *
 FROM (
-  SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000
+  select * from (SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000)a
   UNION ALL
-  SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000
+  select * from (SELECT key, value, ds, hr from srcpart where ds='2008-04-08' limit 1000)b
 ) a
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@srcpart

Modified: hive/trunk/ql/src/test/results/clientpositive/union_top_level.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/union_top_level.q.out?rev=1658489&r1=1658488&r2=1658489&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/union_top_level.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/union_top_level.q.out Mon Feb  9 18:07:01
2015
@@ -2,21 +2,21 @@ PREHOOK: query: -- SORT_QUERY_RESULTS
 
 -- top level
 explain
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 PREHOOK: type: QUERY
 POSTHOOK: query: -- SORT_QUERY_RESULTS
 
 -- top level
 explain
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -171,19 +171,19 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-PREHOOK: query: select key, 0 as value from src where key % 3 == 0 limit 3
+PREHOOK: query: select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 #### A masked pattern was here ####
-POSTHOOK: query: select key, 0 as value from src where key % 3 == 0 limit 3
+POSTHOOK: query: select * from (select key, 0 as value from src where key % 3 == 0 limit
3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
@@ -197,14 +197,14 @@ POSTHOOK: Input: default@src
 484	1
 86	2
 PREHOOK: query: explain
-select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key) limit 10
+select * from (select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key)
limit 10)a
 union all
-select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key) limit 10
+select * from (select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key)
limit 10)b
 PREHOOK: type: QUERY
 POSTHOOK: query: explain
-select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key) limit 10
+select * from (select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key)
limit 10)a
 union all
-select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key) limit 10
+select * from (select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key)
limit 10)b
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -405,15 +405,15 @@ STAGE PLANS:
       Processor Tree:
         ListSink
 
-PREHOOK: query: select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key)
limit 10
+PREHOOK: query: select * from (select s1.key as k, s2.value as v from src s1 join src s2
on (s1.key = s2.key) limit 10)a
 union all
-select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key) limit 10
+select * from (select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key)
limit 10)b
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 #### A masked pattern was here ####
-POSTHOOK: query: select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key)
limit 10
+POSTHOOK: query: select * from (select s1.key as k, s2.value as v from src s1 join src s2
on (s1.key = s2.key) limit 10)a
 union all
-select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key) limit 10
+select * from (select s1.key as k, s2.value as v from src s1 join src s2 on (s1.key = s2.key)
limit 10)b
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 #### A masked pattern was here ####
@@ -440,20 +440,20 @@ POSTHOOK: Input: default@src
 PREHOOK: query: -- ctas
 explain
 create table union_top as
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 PREHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: query: -- ctas
 explain
 create table union_top as
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 POSTHOOK: type: CREATETABLE_AS_SELECT
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -670,21 +670,21 @@ STAGE PLANS:
                   serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
 PREHOOK: query: create table union_top as
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 PREHOOK: type: CREATETABLE_AS_SELECT
 PREHOOK: Input: default@src
 PREHOOK: Output: database:default
 PREHOOK: Output: default@union_top
 POSTHOOK: query: create table union_top as
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 POSTHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: Input: default@src
 POSTHOOK: Output: database:default
@@ -715,20 +715,20 @@ POSTHOOK: Output: default@union_top
 PREHOOK: query: -- insert into
 explain
 insert into table union_top
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 PREHOOK: type: QUERY
 POSTHOOK: query: -- insert into
 explain
 insert into table union_top
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -939,20 +939,20 @@ STAGE PLANS:
                   serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
 PREHOOK: query: insert into table union_top
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 PREHOOK: Output: default@union_top
 POSTHOOK: query: insert into table union_top
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 POSTHOOK: Output: default@union_top
@@ -977,19 +977,19 @@ POSTHOOK: Input: default@union_top
 86	2
 PREHOOK: query: explain
 insert overwrite table union_top
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 PREHOOK: type: QUERY
 POSTHOOK: query: explain
 insert overwrite table union_top
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 POSTHOOK: type: QUERY
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -1200,20 +1200,20 @@ STAGE PLANS:
                   serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe
 
 PREHOOK: query: insert overwrite table union_top
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 PREHOOK: type: QUERY
 PREHOOK: Input: default@src
 PREHOOK: Output: default@union_top
 POSTHOOK: query: insert overwrite table union_top
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@src
 POSTHOOK: Output: default@union_top
@@ -1239,20 +1239,20 @@ POSTHOOK: Input: default@union_top
 PREHOOK: query: -- create view
 explain
 create view union_top_view as
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 PREHOOK: type: CREATEVIEW
 POSTHOOK: query: -- create view
 explain
 create view union_top_view as
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 POSTHOOK: type: CREATEVIEW
 STAGE DEPENDENCIES:
   Stage-0 is a root stage
@@ -1263,34 +1263,34 @@ STAGE PLANS:
         Create View
           or replace: false
           columns: key string, value int
-          expanded text: select `src`.`key`, 0 as `value` from `default`.`src` where `src`.`key`
% 3 == 0 limit 3
+          expanded text: select `a`.`key`, `a`.`value` from (select `src`.`key`, 0 as `value`
from `default`.`src` where `src`.`key` % 3 == 0 limit 3)`a`
 union all
-select `src`.`key`, 1 as `value` from `default`.`src` where `src`.`key` % 3 == 1 limit 3
+select `b`.`key`, `b`.`value` from (select `src`.`key`, 1 as `value` from `default`.`src`
where `src`.`key` % 3 == 1 limit 3)`b`
 union all
-select `src`.`key`, 2 as `value` from `default`.`src` where `src`.`key` % 3 == 2 limit 3
+select `c`.`key`, `c`.`value` from (select `src`.`key`, 2 as `value` from `default`.`src`
where `src`.`key` % 3 == 2 limit 3)`c`
           name: default.union_top_view
-          original text: select key, 0 as value from src where key % 3 == 0 limit 3
+          original text: select * from (select key, 0 as value from src where key % 3 ==
0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 
 PREHOOK: query: create view union_top_view as
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 PREHOOK: type: CREATEVIEW
 PREHOOK: Input: default@src
 PREHOOK: Output: database:default
 PREHOOK: Output: default@union_top_view
 POSTHOOK: query: create view union_top_view as
-select key, 0 as value from src where key % 3 == 0 limit 3
+select * from (select key, 0 as value from src where key % 3 == 0 limit 3)a
 union all
-select key, 1 as value from src where key % 3 == 1 limit 3
+select * from (select key, 1 as value from src where key % 3 == 1 limit 3)b
 union all
-select key, 2 as value from src where key % 3 == 2 limit 3
+select * from (select key, 2 as value from src where key % 3 == 2 limit 3)c
 POSTHOOK: type: CREATEVIEW
 POSTHOOK: Input: default@src
 POSTHOOK: Output: database:default

Modified: hive/trunk/ql/src/test/results/clientpositive/varchar_union1.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/varchar_union1.q.out?rev=1658489&r1=1658488&r2=1658489&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/varchar_union1.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/varchar_union1.q.out Mon Feb  9 18:07:01
2015
@@ -95,9 +95,6 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@varchar_union1_vc1
 #### A masked pattern was here ####
 1	abc
-1	abc
-2	abc 
-3	 abc
 PREHOOK: query: -- union varchar with different length varchar
 select * from (
   select * from varchar_union1_vc1
@@ -119,9 +116,6 @@ POSTHOOK: Input: default@varchar_union1_
 POSTHOOK: Input: default@varchar_union1_vc2
 #### A masked pattern was here ####
 1	abc
-1	abc
-2	abc 
-3	 abc
 PREHOOK: query: -- union varchar with string
 select * from (
   select * from varchar_union1_vc1
@@ -143,9 +137,6 @@ POSTHOOK: Input: default@varchar_union1_
 POSTHOOK: Input: default@varchar_union1_vc1
 #### A masked pattern was here ####
 1	abc
-1	abc
-2	abc 
-3	 abc
 PREHOOK: query: drop table varchar_union1_vc1
 PREHOOK: type: DROPTABLE
 PREHOOK: Input: default@varchar_union1_vc1

Modified: hive/trunk/ql/src/test/results/clientpositive/vector_multi_insert.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/vector_multi_insert.q.out?rev=1658489&r1=1658488&r2=1658489&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/vector_multi_insert.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/vector_multi_insert.q.out Mon Feb  9 18:07:01
2015
@@ -5,11 +5,11 @@ PREHOOK: query: create table orc1
     select rn
     from
     (
-      select cast(1 as int) as rn from src limit 1
+      select * from (select cast(1 as int) as rn from src limit 1)a
       union all
-      select cast(100 as int) as rn from src limit 1
+      select * from (select cast(100 as int) as rn from src limit 1)b
       union all
-      select cast(10000 as int) as rn from src limit 1
+      select * from (select cast(10000 as int) as rn from src limit 1)c
     ) t
 PREHOOK: type: CREATETABLE_AS_SELECT
 PREHOOK: Input: default@src
@@ -22,11 +22,11 @@ POSTHOOK: query: create table orc1
     select rn
     from
     (
-      select cast(1 as int) as rn from src limit 1
+      select * from (select cast(1 as int) as rn from src limit 1)a
       union all
-      select cast(100 as int) as rn from src limit 1
+      select * from (select cast(100 as int) as rn from src limit 1)b
       union all
-      select cast(10000 as int) as rn from src limit 1
+      select * from (select cast(10000 as int) as rn from src limit 1)c
     ) t
 POSTHOOK: type: CREATETABLE_AS_SELECT
 POSTHOOK: Input: default@src



Mime
View raw message