Drill-278: fix for Join predicate with CHAR types hit run-time error
authorJinfeng Ni <jni@maprtech.com>
Fri, 8 Nov 2013 17:23:22 +0000 (09:23 -0800)
committerJacques Nadeau <jacques@apache.org>
Fri, 8 Nov 2013 17:23:22 +0000 (09:23 -0800)
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/MergeJoinBatch.java

index 1f5c707..1e20e91 100644 (file)
@@ -340,13 +340,8 @@ public class MergeJoinBatch extends AbstractRecordBatch<MergeJoinPOP> {
     }
 
     // check value equality
-    cg.getEvalBlock()._if(compareThisLeftExprHolder.getValue().eq(compareNextLeftExprHolder.getValue()))
-                     ._then()
-                       ._return(JExpr.lit(0));
-
-    // no match if reached
-    cg.getEvalBlock()._return(JExpr.lit(1));
-
+    FunctionCall g = new FunctionCall(ComparatorFunctions.COMPARE_TO, ImmutableList.of((LogicalExpression) new HoldingContainerExpression(compareThisLeftExprHolder), (LogicalExpression)  new HoldingContainerExpression(compareNextLeftExprHolder)), ExpressionPosition.UNKNOWN);
+    cg.addExpr(new ReturnValueExpression(g, false), false);
 
     // generate copyLeft()
     //////////////////////