hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1616800 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java
Date Fri, 08 Aug 2014 15:21:13 GMT
Author: hashutosh
Date: Fri Aug  8 15:21:12 2014
New Revision: 1616800

URL: http://svn.apache.org/r1616800
Log:
HIVE-7600 : ConstantPropagateProcFactory uses reference equality on Boolean (Kang HS via Ashutosh
Chauhan)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java?rev=1616800&r1=1616799&r2=1616800&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java
(original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConstantPropagateProcFactory.java
Fri Aug  8 15:21:12 2014
@@ -348,9 +348,9 @@ public final class ConstantPropagateProc
         ExprNodeDesc childExpr = newExprs.get(i);
         if (childExpr instanceof ExprNodeConstantDesc) {
           ExprNodeConstantDesc c = (ExprNodeConstantDesc) childExpr;
-          if (c.getValue() == Boolean.TRUE) {
+          if (Boolean.TRUE.equals(c.getValue())) {
 
-            // if true, prune it
+        	  // if true, prune it
             return newExprs.get(Math.abs(i - 1));
           } else {
 
@@ -366,7 +366,7 @@ public final class ConstantPropagateProc
         ExprNodeDesc childExpr = newExprs.get(i);
         if (childExpr instanceof ExprNodeConstantDesc) {
           ExprNodeConstantDesc c = (ExprNodeConstantDesc) childExpr;
-          if (c.getValue() == Boolean.FALSE) {
+          if (Boolean.FALSE.equals(c.getValue())) {
 
             // if false, prune it
             return newExprs.get(Math.abs(i - 1));
@@ -565,10 +565,10 @@ public final class ConstantPropagateProc
       ExprNodeDesc newCondn = foldExpr(condn, constants, cppCtx, op, 0, true);
       if (newCondn instanceof ExprNodeConstantDesc) {
         ExprNodeConstantDesc c = (ExprNodeConstantDesc) newCondn;
-        if (c.getValue() == Boolean.TRUE) {
+        if (Boolean.TRUE.equals(c.getValue())) {
           cppCtx.addOpToDelete(op);
           LOG.debug("Filter expression " + condn + " holds true. Will delete it.");
-        } else if (c.getValue() == Boolean.FALSE) {
+        } else if (Boolean.FALSE.equals(c.getValue())) {
           LOG.warn("Filter expression " + condn + " holds false!");
         }
       }



Mime
View raw message