hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1156787 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java test/queries/clientpositive/ppd_udf_col.q test/results/clientpositive/ppd_udf_col.q.out
Date Thu, 11 Aug 2011 20:03:55 GMT
Author: jvs
Date: Thu Aug 11 20:03:54 2011
New Revision: 1156787

URL: http://svn.apache.org/viewvc?rev=1156787&view=rev
Log:
HIVE-1538. filter is removed due to regression of HIVE-1538
(Amareshwari Sriramadasu via jvs)


Added:
    hive/trunk/ql/src/test/queries/clientpositive/ppd_udf_col.q
    hive/trunk/ql/src/test/results/clientpositive/ppd_udf_col.q.out
Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java?rev=1156787&r1=1156786&r2=1156787&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/ExprWalkerProcFactory.java Thu Aug
11 20:03:54 2011
@@ -73,6 +73,7 @@ public final class ExprWalkerProcFactory
       Operator<? extends Serializable> op = ctx.getOp();
       String[] colAlias = toRR.reverseLookup(colref.getColumn());
 
+      boolean isCandidate = true;
       if (op.getColumnExprMap() != null) {
         // replace the output expression with the input expression so that
         // parent op can understand this expression
@@ -82,9 +83,13 @@ public final class ExprWalkerProcFactory
           // group by
           ctx.setIsCandidate(colref, false);
           return false;
+        } else {
+          if (exp instanceof ExprNodeGenericFuncDesc) {
+            isCandidate = false;
+          }
         }
         ctx.addConvertedNode(colref, exp);
-        ctx.setIsCandidate(exp, true);
+        ctx.setIsCandidate(exp, isCandidate);
         ctx.addAlias(exp, colAlias[0]);
       } else {
         if (colAlias == null) {
@@ -92,8 +97,8 @@ public final class ExprWalkerProcFactory
         }
         ctx.addAlias(colref, colAlias[0]);
       }
-      ctx.setIsCandidate(colref, true);
-      return true;
+      ctx.setIsCandidate(colref, isCandidate);
+      return isCandidate;
     }
 
   }

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java?rev=1156787&r1=1156786&r2=1156787&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java Thu Aug 11 20:03:54
2011
@@ -197,8 +197,14 @@ public final class OpProcFactory {
         owi.putPrunedPreds((Operator<? extends Serializable>) nd, ewi);
       }
       // merge it with children predicates
-      mergeWithChildrenPred(op, owi, ewi, null, false);
-
+      boolean hasUnpushedPredicates = mergeWithChildrenPred(nd, owi, ewi, null, false);
+      if (HiveConf.getBoolVar(owi.getParseContext().getConf(),
+          HiveConf.ConfVars.HIVEPPDREMOVEDUPLICATEFILTERS)) {
+        if (hasUnpushedPredicates) {
+          ExprWalkerInfo unpushedPreds = mergeChildrenPred(nd, owi, null, false);
+          return createFilter((Operator)nd, unpushedPreds, owi);
+        }
+      }
       return null;
     }
   }

Added: hive/trunk/ql/src/test/queries/clientpositive/ppd_udf_col.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/ppd_udf_col.q?rev=1156787&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/ppd_udf_col.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/ppd_udf_col.q Thu Aug 11 20:03:54 2011
@@ -0,0 +1,48 @@
+set hive.optimize.ppd=true;
+set hive.ppd.remove.duplicatefilters=false;
+
+EXPLAIN
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1;
+
+EXPLAIN 
+SELECT * FROM
+(
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1)s WHERE s.randum123>0.1 LIMIT 20;
+
+EXPLAIN
+SELECT key,randum123, h4
+FROM (SELECT *, cast(rand() as double) AS randum123, hex(4) AS h4 FROM src WHERE key = 100)
a
+WHERE a.h4 <= 3;
+
+EXPLAIN
+SELECT key,randum123, v10
+FROM (SELECT *, cast(rand() as double) AS randum123, value*10 AS v10 FROM src WHERE key =
100) a
+WHERE a.v10 <= 200;
+
+set hive.ppd.remove.duplicatefilters=true;
+
+EXPLAIN
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1;
+
+EXPLAIN 
+SELECT * FROM
+(
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1)s WHERE s.randum123>0.1 LIMIT 20;
+
+EXPLAIN
+SELECT key,randum123, h4
+FROM (SELECT *, cast(rand() as double) AS randum123, hex(4) AS h4 FROM src WHERE key = 100)
a
+WHERE a.h4 <= 3;
+
+EXPLAIN
+SELECT key,randum123, v10
+FROM (SELECT *, cast(rand() as double) AS randum123, value*10 AS v10 FROM src WHERE key =
100) a
+WHERE a.v10 <= 200;

Added: hive/trunk/ql/src/test/results/clientpositive/ppd_udf_col.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/ppd_udf_col.q.out?rev=1156787&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/ppd_udf_col.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/ppd_udf_col.q.out Thu Aug 11 20:03:54 2011
@@ -0,0 +1,524 @@
+PREHOOK: query: EXPLAIN
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src)))
(TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)
(TOK_SELEXPR (TOK_FUNCTION TOK_DOUBLE (TOK_FUNCTION rand)) randum123)) (TOK_WHERE (= (TOK_TABLE_OR_COL
key) 100)))) a)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR
(TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL randum123))) (TOK_WHERE (<= (TOK_TABLE_OR_COL
randum123) 0.1))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a:src 
+          TableScan
+            alias: src
+            Filter Operator
+              predicate:
+                  expr: (key = 100)
+                  type: boolean
+              Filter Operator
+                predicate:
+                    expr: (key = 100)
+                    type: boolean
+                Select Operator
+                  expressions:
+                        expr: key
+                        type: string
+                        expr: rand()
+                        type: double
+                  outputColumnNames: _col0, _col2
+                  Filter Operator
+                    predicate:
+                        expr: (_col2 <= 0.1)
+                        type: boolean
+                    Select Operator
+                      expressions:
+                            expr: _col0
+                            type: string
+                            expr: _col2
+                            type: double
+                      outputColumnNames: _col0, _col1
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: EXPLAIN 
+SELECT * FROM
+(
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1)s WHERE s.randum123>0.1 LIMIT 20
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN 
+SELECT * FROM
+(
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1)s WHERE s.randum123>0.1 LIMIT 20
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM
(TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT
(TOK_SELEXPR TOK_ALLCOLREF) (TOK_SELEXPR (TOK_FUNCTION TOK_DOUBLE (TOK_FUNCTION rand)) randum123))
(TOK_WHERE (= (TOK_TABLE_OR_COL key) 100)))) a)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE))
(TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL randum123)))
(TOK_WHERE (<= (TOK_TABLE_OR_COL randum123) 0.1)))) s)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR
TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (> (. (TOK_TABLE_OR_COL
s) randum123) 0.1)) (TOK_LIMIT 20)))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        s:a:src 
+          TableScan
+            alias: src
+            Filter Operator
+              predicate:
+                  expr: (key = 100)
+                  type: boolean
+              Filter Operator
+                predicate:
+                    expr: (key = 100)
+                    type: boolean
+                Select Operator
+                  expressions:
+                        expr: key
+                        type: string
+                        expr: rand()
+                        type: double
+                  outputColumnNames: _col0, _col2
+                  Filter Operator
+                    predicate:
+                        expr: (_col2 <= 0.1)
+                        type: boolean
+                    Select Operator
+                      expressions:
+                            expr: _col0
+                            type: string
+                            expr: _col2
+                            type: double
+                      outputColumnNames: _col0, _col1
+                      Filter Operator
+                        predicate:
+                            expr: (_col1 > 0.1)
+                            type: boolean
+                        Select Operator
+                          expressions:
+                                expr: _col0
+                                type: string
+                                expr: _col1
+                                type: double
+                          outputColumnNames: _col0, _col1
+                          Limit
+                            File Output Operator
+                              compressed: false
+                              GlobalTableId: 0
+                              table:
+                                  input format: org.apache.hadoop.mapred.TextInputFormat
+                                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 20
+
+
+PREHOOK: query: EXPLAIN
+SELECT key,randum123, h4
+FROM (SELECT *, cast(rand() as double) AS randum123, hex(4) AS h4 FROM src WHERE key = 100)
a
+WHERE a.h4 <= 3
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+SELECT key,randum123, h4
+FROM (SELECT *, cast(rand() as double) AS randum123, hex(4) AS h4 FROM src WHERE key = 100)
a
+WHERE a.h4 <= 3
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src)))
(TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)
(TOK_SELEXPR (TOK_FUNCTION TOK_DOUBLE (TOK_FUNCTION rand)) randum123) (TOK_SELEXPR (TOK_FUNCTION
hex 4) h4)) (TOK_WHERE (= (TOK_TABLE_OR_COL key) 100)))) a)) (TOK_INSERT (TOK_DESTINATION
(TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL
randum123)) (TOK_SELEXPR (TOK_TABLE_OR_COL h4))) (TOK_WHERE (<= (. (TOK_TABLE_OR_COL a)
h4) 3))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a:src 
+          TableScan
+            alias: src
+            Filter Operator
+              predicate:
+                  expr: (key = 100)
+                  type: boolean
+              Filter Operator
+                predicate:
+                    expr: (key = 100)
+                    type: boolean
+                Select Operator
+                  expressions:
+                        expr: key
+                        type: string
+                        expr: rand()
+                        type: double
+                        expr: hex(4)
+                        type: string
+                  outputColumnNames: _col0, _col2, _col3
+                  Filter Operator
+                    predicate:
+                        expr: (_col3 <= 3)
+                        type: boolean
+                    Select Operator
+                      expressions:
+                            expr: _col0
+                            type: string
+                            expr: _col2
+                            type: double
+                            expr: _col3
+                            type: string
+                      outputColumnNames: _col0, _col1, _col2
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: EXPLAIN
+SELECT key,randum123, v10
+FROM (SELECT *, cast(rand() as double) AS randum123, value*10 AS v10 FROM src WHERE key =
100) a
+WHERE a.v10 <= 200
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+SELECT key,randum123, v10
+FROM (SELECT *, cast(rand() as double) AS randum123, value*10 AS v10 FROM src WHERE key =
100) a
+WHERE a.v10 <= 200
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src)))
(TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)
(TOK_SELEXPR (TOK_FUNCTION TOK_DOUBLE (TOK_FUNCTION rand)) randum123) (TOK_SELEXPR (* (TOK_TABLE_OR_COL
value) 10) v10)) (TOK_WHERE (= (TOK_TABLE_OR_COL key) 100)))) a)) (TOK_INSERT (TOK_DESTINATION
(TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL
randum123)) (TOK_SELEXPR (TOK_TABLE_OR_COL v10))) (TOK_WHERE (<= (. (TOK_TABLE_OR_COL a)
v10) 200))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a:src 
+          TableScan
+            alias: src
+            Filter Operator
+              predicate:
+                  expr: (key = 100)
+                  type: boolean
+              Filter Operator
+                predicate:
+                    expr: (key = 100)
+                    type: boolean
+                Select Operator
+                  expressions:
+                        expr: key
+                        type: string
+                        expr: rand()
+                        type: double
+                        expr: (value * 10)
+                        type: double
+                  outputColumnNames: _col0, _col2, _col3
+                  Filter Operator
+                    predicate:
+                        expr: (_col3 <= 200)
+                        type: boolean
+                    Select Operator
+                      expressions:
+                            expr: _col0
+                            type: string
+                            expr: _col2
+                            type: double
+                            expr: _col3
+                            type: double
+                      outputColumnNames: _col0, _col1, _col2
+                      File Output Operator
+                        compressed: false
+                        GlobalTableId: 0
+                        table:
+                            input format: org.apache.hadoop.mapred.TextInputFormat
+                            output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: EXPLAIN
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src)))
(TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)
(TOK_SELEXPR (TOK_FUNCTION TOK_DOUBLE (TOK_FUNCTION rand)) randum123)) (TOK_WHERE (= (TOK_TABLE_OR_COL
key) 100)))) a)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR
(TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL randum123))) (TOK_WHERE (<= (TOK_TABLE_OR_COL
randum123) 0.1))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a:src 
+          TableScan
+            alias: src
+            Filter Operator
+              predicate:
+                  expr: (key = 100)
+                  type: boolean
+              Select Operator
+                expressions:
+                      expr: key
+                      type: string
+                      expr: rand()
+                      type: double
+                outputColumnNames: _col0, _col2
+                Filter Operator
+                  predicate:
+                      expr: (_col2 <= 0.1)
+                      type: boolean
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: string
+                          expr: _col2
+                          type: double
+                    outputColumnNames: _col0, _col1
+                    File Output Operator
+                      compressed: false
+                      GlobalTableId: 0
+                      table:
+                          input format: org.apache.hadoop.mapred.TextInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: EXPLAIN 
+SELECT * FROM
+(
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1)s WHERE s.randum123>0.1 LIMIT 20
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN 
+SELECT * FROM
+(
+SELECT key, randum123
+FROM (SELECT *, cast(rand() as double) AS randum123 FROM src WHERE key = 100) a
+WHERE randum123 <=0.1)s WHERE s.randum123>0.1 LIMIT 20
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM
(TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT
(TOK_SELEXPR TOK_ALLCOLREF) (TOK_SELEXPR (TOK_FUNCTION TOK_DOUBLE (TOK_FUNCTION rand)) randum123))
(TOK_WHERE (= (TOK_TABLE_OR_COL key) 100)))) a)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE))
(TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL randum123)))
(TOK_WHERE (<= (TOK_TABLE_OR_COL randum123) 0.1)))) s)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR
TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (> (. (TOK_TABLE_OR_COL
s) randum123) 0.1)) (TOK_LIMIT 20)))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        s:a:src 
+          TableScan
+            alias: src
+            Filter Operator
+              predicate:
+                  expr: (key = 100)
+                  type: boolean
+              Select Operator
+                expressions:
+                      expr: key
+                      type: string
+                      expr: rand()
+                      type: double
+                outputColumnNames: _col0, _col2
+                Filter Operator
+                  predicate:
+                      expr: ((_col2 <= 0.1) and (_col2 > 0.1))
+                      type: boolean
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: string
+                          expr: _col2
+                          type: double
+                    outputColumnNames: _col0, _col1
+                    Select Operator
+                      expressions:
+                            expr: _col0
+                            type: string
+                            expr: _col1
+                            type: double
+                      outputColumnNames: _col0, _col1
+                      Limit
+                        File Output Operator
+                          compressed: false
+                          GlobalTableId: 0
+                          table:
+                              input format: org.apache.hadoop.mapred.TextInputFormat
+                              output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: 20
+
+
+PREHOOK: query: EXPLAIN
+SELECT key,randum123, h4
+FROM (SELECT *, cast(rand() as double) AS randum123, hex(4) AS h4 FROM src WHERE key = 100)
a
+WHERE a.h4 <= 3
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+SELECT key,randum123, h4
+FROM (SELECT *, cast(rand() as double) AS randum123, hex(4) AS h4 FROM src WHERE key = 100)
a
+WHERE a.h4 <= 3
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src)))
(TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)
(TOK_SELEXPR (TOK_FUNCTION TOK_DOUBLE (TOK_FUNCTION rand)) randum123) (TOK_SELEXPR (TOK_FUNCTION
hex 4) h4)) (TOK_WHERE (= (TOK_TABLE_OR_COL key) 100)))) a)) (TOK_INSERT (TOK_DESTINATION
(TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL
randum123)) (TOK_SELEXPR (TOK_TABLE_OR_COL h4))) (TOK_WHERE (<= (. (TOK_TABLE_OR_COL a)
h4) 3))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a:src 
+          TableScan
+            alias: src
+            Filter Operator
+              predicate:
+                  expr: (key = 100)
+                  type: boolean
+              Select Operator
+                expressions:
+                      expr: key
+                      type: string
+                      expr: rand()
+                      type: double
+                      expr: hex(4)
+                      type: string
+                outputColumnNames: _col0, _col2, _col3
+                Filter Operator
+                  predicate:
+                      expr: (_col3 <= 3)
+                      type: boolean
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: string
+                          expr: _col2
+                          type: double
+                          expr: _col3
+                          type: string
+                    outputColumnNames: _col0, _col1, _col2
+                    File Output Operator
+                      compressed: false
+                      GlobalTableId: 0
+                      table:
+                          input format: org.apache.hadoop.mapred.TextInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+
+
+PREHOOK: query: EXPLAIN
+SELECT key,randum123, v10
+FROM (SELECT *, cast(rand() as double) AS randum123, value*10 AS v10 FROM src WHERE key =
100) a
+WHERE a.v10 <= 200
+PREHOOK: type: QUERY
+POSTHOOK: query: EXPLAIN
+SELECT key,randum123, v10
+FROM (SELECT *, cast(rand() as double) AS randum123, value*10 AS v10 FROM src WHERE key =
100) a
+WHERE a.v10 <= 200
+POSTHOOK: type: QUERY
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src)))
(TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)
(TOK_SELEXPR (TOK_FUNCTION TOK_DOUBLE (TOK_FUNCTION rand)) randum123) (TOK_SELEXPR (* (TOK_TABLE_OR_COL
value) 10) v10)) (TOK_WHERE (= (TOK_TABLE_OR_COL key) 100)))) a)) (TOK_INSERT (TOK_DESTINATION
(TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_TABLE_OR_COL
randum123)) (TOK_SELEXPR (TOK_TABLE_OR_COL v10))) (TOK_WHERE (<= (. (TOK_TABLE_OR_COL a)
v10) 200))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        a:src 
+          TableScan
+            alias: src
+            Filter Operator
+              predicate:
+                  expr: (key = 100)
+                  type: boolean
+              Select Operator
+                expressions:
+                      expr: key
+                      type: string
+                      expr: rand()
+                      type: double
+                      expr: (value * 10)
+                      type: double
+                outputColumnNames: _col0, _col2, _col3
+                Filter Operator
+                  predicate:
+                      expr: (_col3 <= 200)
+                      type: boolean
+                  Select Operator
+                    expressions:
+                          expr: _col0
+                          type: string
+                          expr: _col2
+                          type: double
+                          expr: _col3
+                          type: double
+                    outputColumnNames: _col0, _col1, _col2
+                    File Output Operator
+                      compressed: false
+                      GlobalTableId: 0
+                      table:
+                          input format: org.apache.hadoop.mapred.TextInputFormat
+                          output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+
+



Mime
View raw message