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

Switch to Threaded View
Drill, mail # dev - [3/7] git commit: DRILL-190 (part2) - MergeJoinBatch handles record batches - JoinStatus tracks state across input and output batches - MergeJoinBatchBuilder builds a selection vector of right-side batches which may be rescanned - implement code stub


Copy link to this message
-
[3/7] git commit: DRILL-190 (part2) - MergeJoinBatch handles record batches - JoinStatus tracks state across input and output batches - MergeJoinBatchBuilder builds a selection vector of right-side batches which may be rescanned - implement code stub
jacques@... 2013-08-29, 03:43
DRILL-190 (part2)
 - MergeJoinBatch handles record batches
 - JoinStatus tracks state across input and output batches
 - MergeJoinBatchBuilder builds a selection vector of right-side batches which may be rescanned
 - implement code stubs for merge join
 - add field expression parsing and start of generated merge join code
 - code generator support for merge-join's copyLeft(), copyRight(), compare() and compareNextLeftKey()
 - add line prefixes to generated code log
 - support VectorContainers in declareVectorValueSetupAndMember()
 - fix vector allocation in MergeJoinBatch
 - fix missing values from left batch when right batch has been exhausted
 - fix nullable handling in generated merge join code.  make simple merge join test use multiple batches.
 - fixes for sv4 batch support, additional multi batch test
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/e0bac2f0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/e0bac2f0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/e0bac2f0

Branch: refs/heads/master
Commit: e0bac2f0064be181fd03c18e1bfb243492cd1792
Parents: 8ceee5d
Author: Ben Becker <[EMAIL PROTECTED]>
Authored: Thu Aug 15 21:16:27 2013 -0700
Committer: Jacques Nadeau <[EMAIL PROTECTED]>
Committed: Wed Aug 28 20:36:45 2013 -0700

----------------------------------------------------------------------
 .../drill/exec/compile/JaninoClassCompiler.java |  23 +-
 .../exec/compile/sig/GeneratorMapping.java      |   5 +
 .../physical/base/AbstractPhysicalVisitor.java  |   4 +-
 .../drill/exec/physical/base/GroupScan.java     |   4 +
 .../exec/physical/base/PhysicalVisitor.java     |   4 +-
 .../drill/exec/physical/base/SubScan.java       |   4 +
 .../exec/physical/config/MergeJoinPOP.java      |   4 +
 .../drill/exec/physical/impl/ImplCreator.java   |   9 +
 .../exec/physical/impl/join/JoinEvaluator.java  |   9 +-
 .../physical/impl/join/JoinInnerSignature.java  |  35 ++
 .../exec/physical/impl/join/JoinStatus.java     |  80 +++--
 .../exec/physical/impl/join/JoinTemplate.java   | 110 ++++--
 .../exec/physical/impl/join/JoinWorker.java     |  14 +-
 .../exec/physical/impl/join/MergeJoinBatch.java | 341 +++++++++++++++++--
 .../impl/join/MergeJoinBatchBuilder.java        |   6 +-
 .../physical/impl/join/MergeJoinCreator.java    |  38 +++
 .../exec/physical/impl/join/TestMergeJoin.java  | 220 ++++++++++++
 .../src/test/resources/join/merge_join.json     |  52 +++
 .../test/resources/join/merge_multi_batch.json  |  47 +++
 .../resources/join/merge_multi_batch.left.json  |  13 +
 .../resources/join/merge_multi_batch.right.json |  11 +
 .../test/resources/join/merge_single_batch.json |  37 ++
 .../resources/join/merge_single_batch.left.json |  13 +
 .../join/merge_single_batch.right.json          |  11 +
 24 files changed, 996 insertions(+), 98 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/e0bac2f0/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JaninoClassCompiler.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JaninoClassCompiler.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JaninoClassCompiler.java
index abe2afe..154aca4 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JaninoClassCompiler.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JaninoClassCompiler.java
@@ -44,7 +44,9 @@ public class JaninoClassCompiler implements ClassCompiler{
   }
 
   public byte[] getClassByteCode(final String className, final String code) throws CompileException, IOException, ClassNotFoundException, ClassTransformationException {
-    logger.debug("Compiling:\n {}", code);
+    if(logger.isDebugEnabled()){
+      logger.debug("Compiling:\n {}", prefixLineNumbers(code));
+    }
     StringReader reader = new StringReader(code);
     Scanner scanner = new Scanner((String) null, reader);
     Java.CompilationUnit compilationUnit = new Parser(scanner).parseCompilationUnit();
@@ -55,6 +57,25 @@ public class JaninoClassCompiler implements ClassCompiler{
     return classFiles[0].toByteArray();
   }
 
+
+  private String prefixLineNumbers(String code) {
+    if (!debugLines) return code;
+    StringBuilder out = new StringBuilder();
+    int i = 1;
+    for (String line : code.split("\n")) {
+      int start = out.length();
+      out.append(i++);
+      int numLength = out.length() - start;
+      out.append(":");
+      for (int spaces = 0; spaces < 7 - numLength; ++spaces){
+        out.append(" ");
+      }
+      out.append(line);
+      out.append('\n');
+    }
+    return out.toString();
+  }
+
   public void setDebuggingInformation(boolean debugSource, boolean debugLines, boolean debugVars) {
     this.debugSource = debugSource;
     this.debugLines = debugLines;

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/e0bac2f0/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/compile/sig/GeneratorMapping.java
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/compile/sig/GeneratorMapping.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/compile/sig/GeneratorMapping.java
index 8646b9b..09639df 100644
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/compile/sig/GeneratorMapping.java
@@ -12,6 +12,7 @@ public class GeneratorMapping {
   private String reset;
   private String cleanup;
  
+
   public GeneratorMapping(String setup, String eval, String reset, String cleanup) {
     super();
     this.setup = setup;
@@ -20,6 +21,10 @@ public class GeneratorMapping {
     this.cleanup = cleanup;
   }
 
+  public static Gene