hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1633716 - /hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java
Date Wed, 22 Oct 2014 20:39:01 GMT
Author: sershe
Date: Wed Oct 22 20:39:00 2014
New Revision: 1633716

URL: http://svn.apache.org/r1633716
Log:
HIVE-8547 : CBO and/or constant propagation breaks partition_varchar2 test (Sergey Shelukhin,
reviewed by Ashutosh Chauhan)

Modified:
    hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java

Modified: hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java?rev=1633716&r1=1633715&r2=1633716&view=diff
==============================================================================
--- hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java
(original)
+++ hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java
Wed Oct 22 20:39:00 2014
@@ -361,13 +361,10 @@ public final class ConstantPropagateProc
   }
 
   private static ExprNodeColumnDesc getColumnExpr(ExprNodeDesc expr) {
-    if (expr instanceof ExprNodeColumnDesc) {
-      return (ExprNodeColumnDesc)expr;
+    while (FunctionRegistry.isOpCast(expr)) {
+      expr = expr.getChildren().get(0);
     }
-    if (FunctionRegistry.isOpCast(expr)) {
-      return (ExprNodeColumnDesc)expr.getChildren().get(0);
-    }
-    return null;
+    return (expr instanceof ExprNodeColumnDesc) ? (ExprNodeColumnDesc)expr : null;
   }
 
   private static ExprNodeDesc shortcutFunction(GenericUDF udf, List<ExprNodeDesc> newExprs)
{



Mime
View raw message