Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Drill, mail # dev - [2/2] git commit: Improve projection, filter and svremover tests. Fix bugs introduced by addition of accessors.


Copy link to this message
-
[2/2] git commit: Improve projection, filter and svremover tests. Fix bugs introduced by addition of accessors.
jacques@... 2013-07-23, 05:10
Improve projection, filter and svremover tests.
Fix bugs introduced by addition of accessors.
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/93ddf266
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/93ddf266
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/93ddf266

Branch: refs/heads/master
Commit: 93ddf2660a8bfe1e6cf938580fb5053de1547f44
Parents: 430e0c0
Author: Jacques Nadeau <[EMAIL PROTECTED]>
Authored: Mon Jul 22 21:55:15 2013 -0700
Committer: Jacques Nadeau <[EMAIL PROTECTED]>
Committed: Mon Jul 22 22:01:48 2013 -0700

----------------------------------------------------------------------
 .../java/org/apache/drill/exec/expr/EvaluationVisitor.java  | 8 ++++----
 .../drill/exec/physical/impl/project/ProjectorTemplate.java | 4 ++--
 .../drill/exec/physical/impl/filter/TestSimpleFilter.java   | 8 +++++++-
 .../exec/physical/impl/project/TestSimpleProjection.java    | 9 ++++++++-
 .../drill/exec/physical/impl/svremover/TestSVRemover.java   | 9 ++++++++-
 5 files changed, 29 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/93ddf266/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java
index c9e3c22..664940d 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java
@@ -153,11 +153,11 @@ public class EvaluationVisitor extends AbstractExprVisitor<HoldingContainer, Cod
     generator.getSetupBlock().assign(vv, JExpr.cast(vvType, obj));
    
     if(hc.isOptional()){
-      vv.invoke("set").arg(JExpr.direct("outIndex"));
+      vv.invoke("getMutator").invoke("set").arg(JExpr.direct("outIndex"));
       JConditional jc = block._if(hc.getIsSet().eq(JExpr.lit(0)).not());
       block = jc._then();
     }
-    block.add(vv.invoke("set").arg(JExpr.direct("outIndex")).arg(hc.getValue()));
+    block.add(vv.invoke("getMutator").invoke("set").arg(JExpr.direct("outIndex")).arg(hc.getValue()));
 
     return null;
   }
@@ -185,13 +185,13 @@ public class EvaluationVisitor extends AbstractExprVisitor<HoldingContainer, Cod
       blk.assign(out.getIsSet(), vv1.invoke("isSet").arg(JExpr.direct("inIndex")));
       JConditional jc = blk._if(out.getIsSet());
       jc._then() //
-        .assign(out.getValue(), vv1.invoke("get").arg(JExpr.direct("inIndex"))); //
+        .assign(out.getValue(), vv1.invoke("getAccessor").invoke("get").arg(JExpr.direct("inIndex"))); //
         //.assign(out.getIsSet(), JExpr.lit(1));
       //jc._else()
         //.assign(out.getIsSet(), JExpr.lit(0));
      
     }else{
-      generator.getBlock().assign(out.getValue(), vv1.invoke("get").arg(JExpr.direct("inIndex")));
+      generator.getBlock().assign(out.getValue(), vv1.invoke("getAccessor").invoke("get").arg(JExpr.direct("inIndex")));
     }
     return out;
   }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/93ddf266/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectorTemplate.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectorTemplate.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectorTemplate.java
index 735d355..646e6d1 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectorTemplate.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectorTemplate.java
@@ -68,10 +68,10 @@ public abstract class ProjectorTemplate implements Projector {
       break;
     }
     this.transfers = ImmutableList.copyOf(transfers);
-    setupEval(context, incoming, outgoing);
+    doSetup(context, incoming, outgoing);
   }
 
-  protected abstract void setupEval(FragmentContext context, RecordBatch incoming, RecordBatch outgoing) throws SchemaChangeException;
+  protected abstract void doSetup(FragmentContext context, RecordBatch incoming, RecordBatch outgoing) throws SchemaChangeException;
   protected abstract void doEval(int inIndex, int outIndex);
 
  

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/93ddf266/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestSimpleFilter.java
diff --git a/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestSimpleFilter.java b/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestSimpleFilter.java
index 96a6139..a905a85 100644
+++ b/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/filter/TestSimpleFilter.java
@@ -31,7 +31,7 @@ public class TestSimpleFilter {
  
  
   @Test
-  public void testFilter(@Injectable final DrillbitContext bitContext, @Injectable UserClientConnection connection) throws Exception{
+  public void testFilter(@Injectable final DrillbitContext bitContext, @Injectable UserClientConnection connection) throws Throwable{
 //    System.out.println(System.getProperty("java.class.path"));
 
    
@@ -49,6 +49,12 @@ public class TestSimpleFilter {
     while(exec.next()){
       assertEquals(50, exec.getSelectionVector2().getCount());
     }
+    
+    if(context.getFailureCause() != null){
+      throw context.getFailureCause();
+    }
+    assertTr