@Override public RESULT visitStoreTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, StoreTableNode node, Stack<LogicalNode> stack) throws TajoException { stack.push(node); RESULT result = visit(context, plan, block, node.getChild(), stack); stack.pop(); return result; }
@Override public RESULT visitStoreTable(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, StoreTableNode node, Stack<LogicalNode> stack) throws TajoException { stack.push(node); RESULT result = visit(context, plan, block, node.getChild(), stack); stack.pop(); return result; }
StoreTableNode storeNode = (StoreTableNode) logicalNode; stack.push(storeNode); leftExec = createPlanRecursive(ctx, storeNode.getChild(), stack); stack.pop(); return createStorePlan(ctx, storeNode, leftExec);
StoreTableNode storeNode = (StoreTableNode) logicalNode; stack.push(storeNode); leftExec = createPlanRecursive(ctx, storeNode.getChild(), stack); stack.pop(); return createStorePlan(ctx, storeNode, leftExec);
/** * Merge child execution blocks. * * @param plan master plan * @param child child block * @param parent parent block who has join nodes * @return */ private ExecutionBlock mergeTwoPhaseJoinIfPossible(MasterPlan plan, ExecutionBlock child, ExecutionBlock parent) throws TajoException { ScanNode scanForChild = findScanForChildEb(child, parent); parentFinder.set(scanForChild); parentFinder.find(parent.getPlan()); LogicalNode parentOfScanForChild = parentFinder.getFound(); LogicalNode rootOfChild = child.getPlan(); if (rootOfChild.getType() == NodeType.STORE) { rootOfChild = ((StoreTableNode)rootOfChild).getChild(); } GlobalPlanRewriteUtil.replaceChild(rootOfChild, scanForChild, parentOfScanForChild); parent = GlobalPlanRewriteUtil.mergeExecutionBlocks(plan, child, parent); parent.removeBroadcastRelation(scanForChild); parent.setPlan(parent.getPlan()); return parent; }
/** * Merge child execution blocks. * * @param plan master plan * @param child child block * @param parent parent block who has join nodes * @return */ private ExecutionBlock mergeTwoPhaseJoinIfPossible(MasterPlan plan, ExecutionBlock child, ExecutionBlock parent) throws TajoException { ScanNode scanForChild = findScanForChildEb(child, parent); parentFinder.set(scanForChild); parentFinder.find(parent.getPlan()); LogicalNode parentOfScanForChild = parentFinder.getFound(); LogicalNode rootOfChild = child.getPlan(); if (rootOfChild.getType() == NodeType.STORE) { rootOfChild = ((StoreTableNode)rootOfChild).getChild(); } GlobalPlanRewriteUtil.replaceChild(rootOfChild, scanForChild, parentOfScanForChild); parent = GlobalPlanRewriteUtil.mergeExecutionBlocks(plan, child, parent); parent.removeBroadcastRelation(scanForChild); parent.setPlan(parent.getPlan()); return parent; }
@Test public final void testStoreTable() throws CloneNotSupportedException, TajoException { QueryContext qc = createQueryContext(); Expr context = sqlAnalyzer.parse(QUERIES[8]); LogicalNode plan = planner.createPlan(qc, context).getRootBlock().getRoot(); testCloneLogicalNode(plan); assertEquals(NodeType.ROOT, plan.getType()); LogicalRootNode root = (LogicalRootNode) plan; assertEquals(NodeType.CREATE_TABLE, root.getChild().getType()); StoreTableNode storeNode = root.getChild(); testQuery7(storeNode.getChild()); }