drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject drill git commit: DRILL-3666: Replace assert check in InterpreterEvaluator.
Date Thu, 20 Aug 2015 23:39:49 GMT
Repository: drill
Updated Branches:
  refs/heads/master 3204df184 -> 32ee76d2e


DRILL-3666: Replace assert check in InterpreterEvaluator.


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/32ee76d2
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/32ee76d2
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/32ee76d2

Branch: refs/heads/master
Commit: 32ee76d2eea21fc0655cd104d0807fcf351334b9
Parents: 3204df1
Author: Jinfeng Ni <jni@apache.org>
Authored: Fri Aug 14 17:58:41 2015 -0700
Committer: Jinfeng Ni <jni@apache.org>
Committed: Thu Aug 20 15:22:38 2015 -0700

----------------------------------------------------------------------
 .../drill/exec/expr/fn/interpreter/InterpreterEvaluator.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/32ee76d2/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/interpreter/InterpreterEvaluator.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/interpreter/InterpreterEvaluator.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/interpreter/InterpreterEvaluator.java
index e081796..0121c80 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/interpreter/InterpreterEvaluator.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/interpreter/InterpreterEvaluator.java
@@ -24,7 +24,6 @@ import java.lang.reflect.Field;
 
 import org.apache.drill.common.exceptions.DrillRuntimeException;
 import org.apache.drill.common.expression.BooleanOperator;
-import org.apache.drill.common.expression.CastExpression;
 import org.apache.drill.common.expression.ConvertExpression;
 import org.apache.drill.common.expression.FunctionCall;
 import org.apache.drill.common.expression.FunctionHolderExpression;
@@ -341,7 +340,8 @@ public class InterpreterEvaluator {
     public ValueHolder visitIfExpression(IfExpression ifExpr, Integer inIndex) throws RuntimeException
{
       ValueHolder condHolder = ifExpr.ifCondition.condition.accept(this, inIndex);
 
-      assert (condHolder instanceof BitHolder || condHolder instanceof NullableBitHolder);
+      Preconditions.checkArgument (condHolder instanceof BitHolder || condHolder instanceof
NullableBitHolder,
+          "IfExpression's condition does not have type of BitHolder or NullableBitHolder.");
 
       Trivalent flag = isBitOn(condHolder);
 
@@ -487,7 +487,8 @@ public class InterpreterEvaluator {
     }
 
     private Trivalent isBitOn(ValueHolder holder) {
-      assert (holder instanceof BitHolder || holder instanceof NullableBitHolder);
+      Preconditions.checkArgument(holder instanceof BitHolder || holder instanceof NullableBitHolder,
+          "Input does not have type of BitHolder or NullableBitHolder.");
 
       if ( (holder instanceof BitHolder && ((BitHolder) holder).value == 1)) {
         return Trivalent.TRUE;


Mime
View raw message