tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject git commit: TAJO-1055: ExecutorPreCompiler does not cache correctly compiled TupleComparators.
Date Wed, 01 Oct 2014 15:39:29 GMT
Repository: tajo
Updated Branches:
  refs/heads/block_iteration 890a96c33 -> a5e27a293


TAJO-1055: ExecutorPreCompiler does not cache correctly compiled TupleComparators.

Closes #152


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

Branch: refs/heads/block_iteration
Commit: a5e27a2932aeb71d5f5e2c36a3f9eeb287d3bbfa
Parents: 890a96c
Author: Hyunsik Choi <hyunsik@apache.org>
Authored: Fri Sep 19 14:16:52 2014 -0700
Committer: Hyunsik Choi <hyunsik@apache.org>
Committed: Wed Oct 1 08:38:57 2014 -0700

----------------------------------------------------------------------
 .../tajo/engine/codegen/ExecutorPreCompiler.java       |  1 +
 .../org/apache/tajo/storage/BaseTupleComparator.java   | 13 +++++--------
 2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/a5e27a29/tajo-core/src/main/java/org/apache/tajo/engine/codegen/ExecutorPreCompiler.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/codegen/ExecutorPreCompiler.java
b/tajo-core/src/main/java/org/apache/tajo/engine/codegen/ExecutorPreCompiler.java
index 815ac69..e9b91d7 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/codegen/ExecutorPreCompiler.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/codegen/ExecutorPreCompiler.java
@@ -45,6 +45,7 @@ public class ExecutorPreCompiler extends BasicLogicalPlanVisitor<ExecutorPreComp
   public static void compile(CompilationContext context, LogicalNode node) throws PlanningException
{
     instance.visit(context, null, null, node, new Stack<LogicalNode>());
     context.compiledEvals = Collections.unmodifiableMap(context.compiledEvals);
+    context.compiledComparators = Collections.unmodifiableMap(context.compiledComparators);
   }
 
   public static Map<Pair<Schema, EvalNode>, EvalNode> compile(TajoClassLoader
classLoader, LogicalNode node)

http://git-wip-us.apache.org/repos/asf/tajo/blob/a5e27a29/tajo-storage/src/main/java/org/apache/tajo/storage/BaseTupleComparator.java
----------------------------------------------------------------------
diff --git a/tajo-storage/src/main/java/org/apache/tajo/storage/BaseTupleComparator.java b/tajo-storage/src/main/java/org/apache/tajo/storage/BaseTupleComparator.java
index c3f77e7..d008b35 100644
--- a/tajo-storage/src/main/java/org/apache/tajo/storage/BaseTupleComparator.java
+++ b/tajo-storage/src/main/java/org/apache/tajo/storage/BaseTupleComparator.java
@@ -39,11 +39,7 @@ public class BaseTupleComparator extends TupleComparator implements ProtoObject<
   private final int[] sortKeyIds;
   private final boolean[] asc;
   @SuppressWarnings("unused")
-  private final boolean[] nullFirsts;  
-
-  private Datum left;
-  private Datum right;
-  private int compVal;
+  private final boolean[] nullFirsts;
 
   /**
    * @param schema The schema of input tuples
@@ -108,9 +104,10 @@ public class BaseTupleComparator extends TupleComparator implements ProtoObject<
 
   @Override
   public int compare(Tuple tuple1, Tuple tuple2) {
+    int compVal = 0;
     for (int i = 0; i < sortKeyIds.length; i++) {
-      left = tuple1.get(sortKeyIds[i]);
-      right = tuple2.get(sortKeyIds[i]);
+      Datum left = tuple1.get(sortKeyIds[i]);
+      Datum right = tuple2.get(sortKeyIds[i]);
 
       if (left.isNull() || right.isNull()) {
         if (!left.equals(right)) {
@@ -144,7 +141,7 @@ public class BaseTupleComparator extends TupleComparator implements ProtoObject<
 
   @Override
   public int hashCode() {
-    return Objects.hashCode(sortKeyIds);
+    return Objects.hashCode(sortSpecs);
   }
 
   @Override


Mime
View raw message