tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject tajo git commit: TAJO-1904: Extend GraphVisitor to accept user-defined context.
Date Tue, 03 Nov 2015 01:34:59 GMT
Repository: tajo
Updated Branches:
  refs/heads/master 90cb945ac -> 3224addb3


TAJO-1904: Extend GraphVisitor to accept user-defined context.

Closes #797


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

Branch: refs/heads/master
Commit: 3224addb3707855bb8326157e873a3faa0761ac3
Parents: 90cb945
Author: Jihoon Son <jihoonson@apache.org>
Authored: Tue Nov 3 10:33:55 2015 +0900
Committer: Jihoon Son <jihoonson@apache.org>
Committed: Tue Nov 3 10:34:48 2015 +0900

----------------------------------------------------------------------
 CHANGES                                         |  2 +
 .../apache/tajo/util/graph/DirectedGraph.java   |  2 +-
 .../tajo/util/graph/DirectedGraphVisitor.java   |  4 +-
 .../tajo/util/graph/SimpleDirectedGraph.java    | 17 ++---
 .../util/graph/TestSimpleDirectedGraph.java     |  6 +-
 .../tajo/engine/planner/global/MasterPlan.java  |  4 +-
 .../rewriter/GlobalPlanRewriteEngine.java       |  2 +-
 .../global/rewriter/GlobalPlanRewriteRule.java  |  2 +-
 .../rewriter/rules/BroadcastJoinRule.java       | 74 +++++++++++---------
 .../rules/GlobalPlanEqualityTester.java         |  2 +-
 .../plan/rewrite/SelfDescSchemaBuildPhase.java  |  6 +-
 11 files changed, 64 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 7212c4c..f3dfd68 100644
--- a/CHANGES
+++ b/CHANGES
@@ -45,6 +45,8 @@ Release 0.12.0 - unreleased
 
   TASKS
 
+    TAJO-1904: Extend GraphVisitor to accept user-defined context. (jihoon)
+
     TAJO-1906: Decrease the default size of hash map and array list for testing.
     (jihoon)
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/tajo-common/src/main/java/org/apache/tajo/util/graph/DirectedGraph.java
----------------------------------------------------------------------
diff --git a/tajo-common/src/main/java/org/apache/tajo/util/graph/DirectedGraph.java b/tajo-common/src/main/java/org/apache/tajo/util/graph/DirectedGraph.java
index 5433ef5..d8d5ced 100644
--- a/tajo-common/src/main/java/org/apache/tajo/util/graph/DirectedGraph.java
+++ b/tajo-common/src/main/java/org/apache/tajo/util/graph/DirectedGraph.java
@@ -60,5 +60,5 @@ public interface DirectedGraph<V, E> extends Graph<V, E> {
   /**
    * It visits all vertices in a post-order traverse way.
    */
-  void accept(V src, DirectedGraphVisitor<V> visitor);
+  <CONTEXT> void accept(CONTEXT context, V src, DirectedGraphVisitor<CONTEXT, V>
visitor);
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/tajo-common/src/main/java/org/apache/tajo/util/graph/DirectedGraphVisitor.java
----------------------------------------------------------------------
diff --git a/tajo-common/src/main/java/org/apache/tajo/util/graph/DirectedGraphVisitor.java
b/tajo-common/src/main/java/org/apache/tajo/util/graph/DirectedGraphVisitor.java
index 139c2b4..8e0ce87 100644
--- a/tajo-common/src/main/java/org/apache/tajo/util/graph/DirectedGraphVisitor.java
+++ b/tajo-common/src/main/java/org/apache/tajo/util/graph/DirectedGraphVisitor.java
@@ -20,6 +20,6 @@ package org.apache.tajo.util.graph;
 
 import java.util.Stack;
 
-public interface DirectedGraphVisitor<V> {
-  void visit(Stack<V> stack, V v);
+public interface DirectedGraphVisitor<CONTEXT, V> {
+  void visit(CONTEXT context, Stack<V> stack, V v);
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/tajo-common/src/main/java/org/apache/tajo/util/graph/SimpleDirectedGraph.java
----------------------------------------------------------------------
diff --git a/tajo-common/src/main/java/org/apache/tajo/util/graph/SimpleDirectedGraph.java
b/tajo-common/src/main/java/org/apache/tajo/util/graph/SimpleDirectedGraph.java
index d3a3a1e..c40338e 100644
--- a/tajo-common/src/main/java/org/apache/tajo/util/graph/SimpleDirectedGraph.java
+++ b/tajo-common/src/main/java/org/apache/tajo/util/graph/SimpleDirectedGraph.java
@@ -219,18 +219,19 @@ public class SimpleDirectedGraph<V, E> implements DirectedGraph<V,E>
{
   }
 
   @Override
-  public void accept(V source, DirectedGraphVisitor<V> visitor) {
+  public <CONTEXT> void accept(CONTEXT context, V source, DirectedGraphVisitor<CONTEXT,
V> visitor) {
     Stack<V> stack = new Stack<>();
-    visitRecursive(stack, source, visitor);
+    visitRecursive(context, stack, source, visitor);
   }
 
-  private void visitRecursive(Stack<V> stack, V current, DirectedGraphVisitor<V>
visitor) {
+  private <CONTEXT> void visitRecursive(CONTEXT context, Stack<V> stack, V current,
+                                        DirectedGraphVisitor<CONTEXT, V> visitor) {
     stack.push(current);
     for (V child : getChilds(current)) {
-      visitRecursive(stack, child, visitor);
+      visitRecursive(context, stack, child, visitor);
     }
     stack.pop();
-    visitor.visit(stack, current);
+    visitor.visit(context, stack, current);
   }
 
   public String toString() {
@@ -248,7 +249,7 @@ public class SimpleDirectedGraph<V, E> implements DirectedGraph<V,E>
{
   public String toStringGraph(V vertex) {
     StringBuilder sb = new StringBuilder();
     QueryGraphTopologyStringBuilder visitor = new QueryGraphTopologyStringBuilder();
-    accept(vertex, visitor);
+    accept(null, vertex, visitor);
     Stack<DepthString> depthStrings = visitor.getDepthStrings();
     while(!depthStrings.isEmpty()) {
       sb.append(printDepthString(depthStrings.pop()));
@@ -266,11 +267,11 @@ public class SimpleDirectedGraph<V, E> implements DirectedGraph<V,E>
{
     }
   }
 
-  private class QueryGraphTopologyStringBuilder implements DirectedGraphVisitor<V>
{
+  private class QueryGraphTopologyStringBuilder implements DirectedGraphVisitor<Object,
V> {
     Stack<DepthString> depthString = new Stack<>();
 
     @Override
-    public void visit(Stack<V> stack, V vertex) {
+    public void visit(Object context, Stack<V> stack, V vertex) {
       depthString.push(new DepthString(stack.size(), vertex.toString()));
     }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/tajo-common/src/test/java/org/apache/tajo/util/graph/TestSimpleDirectedGraph.java
----------------------------------------------------------------------
diff --git a/tajo-common/src/test/java/org/apache/tajo/util/graph/TestSimpleDirectedGraph.java
b/tajo-common/src/test/java/org/apache/tajo/util/graph/TestSimpleDirectedGraph.java
index 2f3a373..45cde2a 100644
--- a/tajo-common/src/test/java/org/apache/tajo/util/graph/TestSimpleDirectedGraph.java
+++ b/tajo-common/src/test/java/org/apache/tajo/util/graph/TestSimpleDirectedGraph.java
@@ -69,13 +69,13 @@ public class TestSimpleDirectedGraph {
     assertEquals(2, graph.getChildCount(child2));
 
     // visitor
-    graph.accept(root, new Visitor());
+    graph.accept(null, root, new Visitor());
   }
 
-  private class Visitor implements DirectedGraphVisitor<String> {
+  private class Visitor implements DirectedGraphVisitor<Object, String> {
 
     @Override
-    public void visit(Stack<String> stack, String s) {
+    public void visit(Object context, Stack<String> stack, String s) {
       if(LOG.isDebugEnabled()) {
         LOG.debug("Element:" + s);
       }

http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/MasterPlan.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/MasterPlan.java
b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/MasterPlan.java
index 90ccc3a..feaba76 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/MasterPlan.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/MasterPlan.java
@@ -215,8 +215,8 @@ public class MasterPlan {
     return getChild(executionBlock.getId(), idx);
   }
 
-  public void accept(ExecutionBlockId v, DirectedGraphVisitor<ExecutionBlockId> visitor)
{
-    execBlockGraph.accept(v, visitor);
+  public <CONTEXT> void accept(CONTEXT context, ExecutionBlockId v, DirectedGraphVisitor<CONTEXT,
ExecutionBlockId> visitor) {
+    execBlockGraph.accept(context, v, visitor);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/GlobalPlanRewriteEngine.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/GlobalPlanRewriteEngine.java
b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/GlobalPlanRewriteEngine.java
index 7132e78..039dde5 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/GlobalPlanRewriteEngine.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/GlobalPlanRewriteEngine.java
@@ -73,7 +73,7 @@ public class GlobalPlanRewriteEngine {
     for (Map.Entry<String, GlobalPlanRewriteRule> rewriteRule : rewriteRules.entrySet())
{
       rule = rewriteRule.getValue();
       if (rule.isEligible(queryContext, plan)) {
-        plan = rule.rewrite(plan);
+        plan = rule.rewrite(queryContext, plan);
         if (LOG.isDebugEnabled()) {
           LOG.debug("The rule \"" + rule.getName() + " \" rewrites the query.");
         }

http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/GlobalPlanRewriteRule.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/GlobalPlanRewriteRule.java
b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/GlobalPlanRewriteRule.java
index f681d2e..0acf956 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/GlobalPlanRewriteRule.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/GlobalPlanRewriteRule.java
@@ -48,5 +48,5 @@ public interface GlobalPlanRewriteRule {
    * @param plan Global Plan
    * @return
    */
-  MasterPlan rewrite(MasterPlan plan) throws TajoException;
+  MasterPlan rewrite(OverridableConf queryContext, MasterPlan plan) throws TajoException;
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/BroadcastJoinRule.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/BroadcastJoinRule.java
b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/BroadcastJoinRule.java
index 2f5d09c..7bb2c30 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/BroadcastJoinRule.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/BroadcastJoinRule.java
@@ -65,12 +65,10 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
   private BroadcastJoinPlanBuilder planBuilder;
   private BroadcastJoinPlanFinalizer planFinalizer;
 
-  protected void init(MasterPlan plan, long thresholdForNonCrossJoin, long thresholdForCrossJoin,
-                      boolean broadcastForNonCrossJoinEnabled) {
+  protected void init(MasterPlan plan) {
     GlobalPlanRewriteUtil.ParentFinder parentFinder = new GlobalPlanRewriteUtil.ParentFinder();
     RelationSizeComparator relSizeComparator = new RelationSizeComparator();
-    planBuilder = new BroadcastJoinPlanBuilder(plan, relSizeComparator, parentFinder, thresholdForNonCrossJoin,
-        thresholdForCrossJoin, broadcastForNonCrossJoinEnabled);
+    planBuilder = new BroadcastJoinPlanBuilder(plan, relSizeComparator, parentFinder);
     planFinalizer = new BroadcastJoinPlanFinalizer(plan, relSizeComparator);
   }
 
@@ -90,7 +88,7 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
         (thresholdForNonCrossJoin > 0 || thresholdForCrossJoin > 0)) {
       for (LogicalPlan.QueryBlock block : plan.getLogicalPlan().getQueryBlocks()) {
         if (block.hasNode(NodeType.JOIN)) {
-          init(plan, thresholdForNonCrossJoin, thresholdForCrossJoin, broadcastJoinEnabled);
+          init(plan);
           return true;
         }
       }
@@ -99,9 +97,13 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
   }
 
   @Override
-  public MasterPlan rewrite(MasterPlan plan) throws TajoException {
-    plan.accept(plan.getRoot().getId(), planBuilder);
-    plan.accept(plan.getRoot().getId(), planFinalizer);
+  public MasterPlan rewrite(OverridableConf queryContext, MasterPlan plan) throws TajoException
{
+    long thresholdForNonCrossJoin = queryContext.getLong(SessionVars.BROADCAST_NON_CROSS_JOIN_THRESHOLD)
*
+        StorageUnit.KB;
+    long thresholdForCrossJoin = queryContext.getLong(SessionVars.BROADCAST_CROSS_JOIN_THRESHOLD)
*
+        StorageUnit.KB;
+    plan.accept(new Context(thresholdForNonCrossJoin, thresholdForCrossJoin), plan.getRoot().getId(),
planBuilder);
+    plan.accept(null, plan.getRoot().getId(), planFinalizer);
     return plan;
   }
 
@@ -125,7 +127,7 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
    * {@Link BroadcastJoinPlanFinalizer} checks whether every input is the broadcast candidate
or not.
    * If so, it removes the broadcast property from the largest relation.
    */
-  private class BroadcastJoinPlanFinalizer implements DirectedGraphVisitor<ExecutionBlockId>
{
+  private class BroadcastJoinPlanFinalizer implements DirectedGraphVisitor<Object, ExecutionBlockId>
{
     private final MasterPlan plan;
     private final RelationSizeComparator relSizeComparator;
 
@@ -135,7 +137,7 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
     }
 
     @Override
-    public void visit(Stack<ExecutionBlockId> stack, ExecutionBlockId currentId) {
+    public void visit(Object context, Stack<ExecutionBlockId> stack, ExecutionBlockId
currentId) {
       ExecutionBlock current = plan.getExecBlock(currentId);
       if (!plan.isTerminal(current)) {
         // When every child is a broadcast candidate, enforce non-broadcast for the largest
relation for the join to be
@@ -150,35 +152,37 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
     }
   }
 
-  private class BroadcastJoinPlanBuilder implements DirectedGraphVisitor<ExecutionBlockId>
{
-    private final MasterPlan plan;
-    private final RelationSizeComparator relSizeComparator;
+  private static class Context {
     private final long thresholdForNonCrossJoin;
     private final long thresholdForCrossJoin;
-    private final boolean broadcastForNonCrossJoinEnabled;
-    private final GlobalPlanRewriteUtil.ParentFinder parentFinder;
     private final Map<ExecutionBlockId, Long> estimatedEbOutputSize = new HashMap<>();
 
+    public Context(long thresholdForNonCrossJoin, long thresholdForCrossJoin) {
+      this.thresholdForNonCrossJoin = thresholdForNonCrossJoin;
+      this.thresholdForCrossJoin = thresholdForCrossJoin;
+    }
+  }
+
+  private class BroadcastJoinPlanBuilder implements DirectedGraphVisitor<Context, ExecutionBlockId>
{
+    private final MasterPlan plan;
+    private final RelationSizeComparator relSizeComparator;
+    private final GlobalPlanRewriteUtil.ParentFinder parentFinder;
+
     public BroadcastJoinPlanBuilder(MasterPlan plan, RelationSizeComparator relationSizeComparator,
-                                    GlobalPlanRewriteUtil.ParentFinder parentFinder,
-                                    long thresholdForNonCrossJoin, long thresholdForCrossJoin,
-                                    boolean broadcastForNonCrossJoinEnabled) {
+                                    GlobalPlanRewriteUtil.ParentFinder parentFinder) {
       this.plan = plan;
       this.relSizeComparator = relationSizeComparator;
-      this.thresholdForNonCrossJoin = thresholdForNonCrossJoin;
-      this.thresholdForCrossJoin = thresholdForCrossJoin;
       this.parentFinder = parentFinder;
-      this.broadcastForNonCrossJoinEnabled = broadcastForNonCrossJoinEnabled;
     }
 
     @Override
-    public void visit(Stack<ExecutionBlockId> stack, ExecutionBlockId executionBlockId)
{
+    public void visit(Context context, Stack<ExecutionBlockId> stack, ExecutionBlockId
executionBlockId) {
       ExecutionBlock current = plan.getExecBlock(executionBlockId);
 
       if (plan.isLeaf(current)) {
-        visitLeafNode(current);
+        visitLeafNode(context, current);
       } else {
-        visitNonLeafNode(current);
+        visitNonLeafNode(context, current);
       }
     }
 
@@ -187,14 +191,14 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
      *
      * @param current
      */
-    private void visitLeafNode(ExecutionBlock current) {
+    private void visitLeafNode(Context context, ExecutionBlock current) {
       // Preserved-row relations must not be broadcasted to avoid data duplication.
       if (!current.isPreservedRow()) {
         long totalVolume = 0;
         for (ScanNode scanNode : current.getScanNodes()) {
           totalVolume += GlobalPlanRewriteUtil.getTableVolume(scanNode);
         }
-        estimatedEbOutputSize.put(current.getId(), totalVolume);
+        context.estimatedEbOutputSize.put(current.getId(), totalVolume);
       }
     }
 
@@ -206,7 +210,7 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
      *
      * @param current
      */
-    private void visitNonLeafNode(ExecutionBlock current) {
+    private void visitNonLeafNode(Context context, ExecutionBlock current) {
       // At non-leaf execution blocks, merge broadcastable children's plan with the current
plan.
 
       if (!plan.isTerminal(current)) {
@@ -222,7 +226,7 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
 
           for (ExecutionBlock child : childs) {
             if (!child.isPreservedRow()) {
-              updateBroadcastableRelForChildEb(child, joinType);
+              updateBroadcastableRelForChildEb(context, child, joinType);
               updateInputBasedOnChildEb(child, current);
             }
           }
@@ -234,10 +238,10 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
               mergeTwoPhaseJoinIfPossible(plan, child, current);
             }
 
-            checkTotalSizeOfBroadcastableRelations(current);
+            checkTotalSizeOfBroadcastableRelations(context, current);
 
             long outputVolume = estimateOutputVolume(current);
-            estimatedEbOutputSize.put(current.getId(), outputVolume);
+            context.estimatedEbOutputSize.put(current.getId(), outputVolume);
           }
         } else {
           List<ScanNode> relations = TUtil.newList(current.getBroadcastRelations());
@@ -262,8 +266,8 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
       }
     }
 
-    private void updateBroadcastableRelForChildEb(ExecutionBlock child, JoinType joinType)
{
-      long threshold = joinType == JoinType.CROSS ? thresholdForCrossJoin : thresholdForNonCrossJoin;
+    private void updateBroadcastableRelForChildEb(Context context, ExecutionBlock child,
JoinType joinType) {
+      long threshold = joinType == JoinType.CROSS ? context.thresholdForCrossJoin : context.thresholdForNonCrossJoin;
       for (ScanNode scanNode : child.getScanNodes()) {
         long volume = GlobalPlanRewriteUtil.getTableVolume(scanNode);
         if (volume >= 0 && volume <= threshold) {
@@ -382,14 +386,14 @@ public class BroadcastJoinRule implements GlobalPlanRewriteRule {
      *
      * @param block
      */
-    private void checkTotalSizeOfBroadcastableRelations(ExecutionBlock block) {
+    private void checkTotalSizeOfBroadcastableRelations(Context context, ExecutionBlock block)
{
       List<ScanNode> broadcastCandidates = TUtil.newList(block.getBroadcastRelations());
       Collections.sort(broadcastCandidates, relSizeComparator);
 
       // Enforce broadcast for candidates in ascending order of relation size
       long totalBroadcastVolume = 0;
-      long largeThreshold = thresholdForCrossJoin > thresholdForNonCrossJoin ?
-          thresholdForCrossJoin : thresholdForNonCrossJoin;
+      long largeThreshold = context.thresholdForCrossJoin > context.thresholdForNonCrossJoin
?
+          context.thresholdForCrossJoin : context.thresholdForNonCrossJoin;
       int i;
       for (i = 0; i < broadcastCandidates.size(); i++) {
         long volumeOfCandidate = GlobalPlanRewriteUtil.getTableVolume(broadcastCandidates.get(i));

http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/GlobalPlanEqualityTester.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/GlobalPlanEqualityTester.java
b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/GlobalPlanEqualityTester.java
index 9f27eed..5758f5e 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/GlobalPlanEqualityTester.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/rewriter/rules/GlobalPlanEqualityTester.java
@@ -44,7 +44,7 @@ public class GlobalPlanEqualityTester implements GlobalPlanRewriteRule {
   }
 
   @Override
-  public MasterPlan rewrite(MasterPlan plan) {
+  public MasterPlan rewrite(OverridableConf queryContext, MasterPlan plan) {
     try {
       ExecutionBlockCursor cursor = new ExecutionBlockCursor(plan);
       for (ExecutionBlock eb : cursor) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/3224addb/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/SelfDescSchemaBuildPhase.java
----------------------------------------------------------------------
diff --git a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/SelfDescSchemaBuildPhase.java
b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/SelfDescSchemaBuildPhase.java
index bd61342..48affc5 100644
--- a/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/SelfDescSchemaBuildPhase.java
+++ b/tajo-plan/src/main/java/org/apache/tajo/plan/rewrite/SelfDescSchemaBuildPhase.java
@@ -449,7 +449,7 @@ public class SelfDescSchemaBuildPhase extends LogicalPlanPreprocessPhase
{
       // Build record columns
       RecordColumnBuilder builder = new RecordColumnBuilder(schemaGraph);
       for (ColumnVertex eachRoot : rootVertexes) {
-        schemaGraph.accept(eachRoot, builder);
+        schemaGraph.accept(null, eachRoot, builder);
         schema.addColumn(eachRoot.column);
       }
 
@@ -511,7 +511,7 @@ public class SelfDescSchemaBuildPhase extends LogicalPlanPreprocessPhase
{
       }
     }
 
-    private static class RecordColumnBuilder implements DirectedGraphVisitor<ColumnVertex>
{
+    private static class RecordColumnBuilder implements DirectedGraphVisitor<Object, ColumnVertex>
{
       private final SchemaGraph graph;
 
       public RecordColumnBuilder(SchemaGraph graph) {
@@ -519,7 +519,7 @@ public class SelfDescSchemaBuildPhase extends LogicalPlanPreprocessPhase
{
       }
 
       @Override
-      public void visit(Stack<ColumnVertex> stack, ColumnVertex schemaVertex) {
+      public void visit(Object context, Stack<ColumnVertex> stack, ColumnVertex schemaVertex)
{
         if (graph.isLeaf(schemaVertex)) {
           schemaVertex.column = new Column(schemaVertex.name, schemaVertex.type);
         } else {


Mime
View raw message