@Override public LogicalNode visitRoot(Context context, LogicalPlan plan, LogicalPlan.QueryBlock block, LogicalRootNode node, Stack<LogicalNode> stack) throws TajoException { LogicalNode child = super.visitRoot(context, plan, block, node, stack); node.setInSchema(child.getOutSchema()); node.setOutSchema(child.getOutSchema()); return node; }
@Override public LogicalNode visitRoot(Context context, LogicalPlan plan, LogicalPlan.QueryBlock block, LogicalRootNode node, Stack<LogicalNode> stack) throws TajoException { LogicalNode child = super.visitRoot(context, plan, block, node, stack); node.setInSchema(child.getOutSchema()); node.setOutSchema(child.getOutSchema()); return node; }
@VisibleForTesting public LogicalPlan createPlan(OverridableConf queryContext, Expr expr, boolean debug) throws TajoException { LogicalPlan plan = new LogicalPlan(); QueryBlock rootBlock = plan.newAndGetBlock(LogicalPlan.ROOT_BLOCK); PlanContext context = new PlanContext(queryContext, plan, rootBlock, evalOptimizer, debug); preprocessor.process(context, expr); plan.resetGeneratedId(); LogicalNode topMostNode = this.visit(context, new Stack<>(), expr); // Add Root Node LogicalRootNode root = plan.createNode(LogicalRootNode.class); root.setInSchema(topMostNode.getOutSchema()); root.setChild(topMostNode); root.setOutSchema(topMostNode.getOutSchema()); plan.getRootBlock().setRoot(root); return plan; }
@VisibleForTesting public LogicalPlan createPlan(OverridableConf queryContext, Expr expr, boolean debug) throws TajoException { LogicalPlan plan = new LogicalPlan(); QueryBlock rootBlock = plan.newAndGetBlock(LogicalPlan.ROOT_BLOCK); PlanContext context = new PlanContext(queryContext, plan, rootBlock, evalOptimizer, debug); preprocessor.process(context, expr); plan.resetGeneratedId(); LogicalNode topMostNode = this.visit(context, new Stack<Expr>(), expr); // Add Root Node LogicalRootNode root = plan.createNode(LogicalRootNode.class); root.setInSchema(topMostNode.getOutSchema()); root.setChild(topMostNode); root.setOutSchema(topMostNode.getOutSchema()); plan.getRootBlock().setRoot(root); return plan; }
private static LogicalRootNode convertRoot(Map<Integer, LogicalNode> nodeMap, PlanProto.LogicalNode protoNode) { PlanProto.RootNode rootProto = protoNode.getRoot(); LogicalRootNode root = new LogicalRootNode(protoNode.getNodeId()); root.setChild(nodeMap.get(rootProto.getChildSeq())); if (protoNode.hasInSchema()) { root.setInSchema(convertSchema(protoNode.getInSchema())); } if (protoNode.hasOutSchema()) { root.setOutSchema(convertSchema(protoNode.getOutSchema())); } return root; }
private static LogicalRootNode convertRoot(Map<Integer, LogicalNode> nodeMap, PlanProto.LogicalNode protoNode) { PlanProto.RootNode rootProto = protoNode.getRoot(); LogicalRootNode root = new LogicalRootNode(protoNode.getNodeId()); root.setChild(nodeMap.get(rootProto.getChildSeq())); if (protoNode.hasInSchema()) { root.setInSchema(convertSchema(protoNode.getInSchema())); } if (protoNode.hasOutSchema()) { root.setOutSchema(convertSchema(protoNode.getOutSchema())); } return root; }
rootNode.setChild(child); rootNode.setInSchema(child.getOutSchema()); rootNode.setOutSchema(child.getOutSchema()); break; case TABLE_SUBQUERY:
rootNode.setChild(child); rootNode.setInSchema(child.getOutSchema()); rootNode.setOutSchema(child.getOutSchema()); break; case TABLE_SUBQUERY: