You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by ja...@apache.org on 2013/07/23 07:10:28 UTC
[2/2] git commit: Improve projection,
filter and svremover tests. Fix bugs introduced by addition of
accessors.
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 <ja...@apache.org>
Authored: Mon Jul 22 21:55:15 2013 -0700
Committer: Jacques Nadeau <ja...@apache.org>
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
--- 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
@@ -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();
+ }
+ assertTrue(!context.isFailed());
+
}
@After
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/project/TestSimpleProjection.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/project/TestSimpleProjection.java b/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/project/TestSimpleProjection.java
index f4900e1..79218d1 100644
--- a/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/project/TestSimpleProjection.java
+++ b/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/project/TestSimpleProjection.java
@@ -1,6 +1,7 @@
package org.apache.drill.exec.physical.impl.project;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import mockit.Injectable;
import mockit.NonStrictExpectations;
@@ -34,7 +35,7 @@ public class TestSimpleProjection {
@Test
- public void project(@Injectable final DrillbitContext bitContext, @Injectable UserClientConnection connection) throws Exception{
+ public void project(@Injectable final DrillbitContext bitContext, @Injectable UserClientConnection connection) throws Throwable{
new NonStrictExpectations(){{
@@ -48,6 +49,7 @@ public class TestSimpleProjection {
FunctionImplementationRegistry registry = new FunctionImplementationRegistry(c);
FragmentContext context = new FragmentContext(bitContext, FragmentHandle.getDefaultInstance(), connection, null, registry);
SimpleRootExec exec = new SimpleRootExec(ImplCreator.getExec(context, (FragmentRoot) plan.getSortedOperators(false).iterator().next()));
+
while(exec.next()){
BigIntVector c1 = exec.getValueVectorById(new SchemaPath("col1", ExpressionPosition.UNKNOWN), BigIntVector.class);
BigIntVector c2 = exec.getValueVectorById(new SchemaPath("col2", ExpressionPosition.UNKNOWN), BigIntVector.class);
@@ -63,6 +65,11 @@ public class TestSimpleProjection {
System.out.println(x);
}
+
+ if(context.getFailureCause() != null){
+ throw context.getFailureCause();
+ }
+ assertTrue(!context.isFailed());
}
@After
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/svremover/TestSVRemover.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/svremover/TestSVRemover.java b/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/svremover/TestSVRemover.java
index f417b91..2dafd0a 100644
--- a/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/svremover/TestSVRemover.java
+++ b/sandbox/prototype/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/svremover/TestSVRemover.java
@@ -1,6 +1,7 @@
package org.apache.drill.exec.physical.impl.svremover;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import mockit.Injectable;
import mockit.NonStrictExpectations;
@@ -32,7 +33,7 @@ public class TestSVRemover {
@Test
- public void testSelectionVectorRemoval(@Injectable final DrillbitContext bitContext, @Injectable UserClientConnection connection) throws Exception{
+ public void testSelectionVectorRemoval(@Injectable final DrillbitContext bitContext, @Injectable UserClientConnection connection) throws Throwable{
// System.out.println(System.getProperty("java.class.path"));
@@ -54,6 +55,12 @@ public class TestSVRemover {
assertEquals(count, a.getValueCount());
}
}
+
+ if(context.getFailureCause() != null){
+ throw context.getFailureCause();
+ }
+ assertTrue(!context.isFailed());
+
}
@After