/** * It makes a plan to store directly union plans into a non-partitioned table. */ private ExecutionBlock buildShuffleAndStorePlanNoPartitionedTableWithUnion(GlobalPlanContext context, StoreTableNode currentNode, ExecutionBlock childBlock) throws TajoException { for (ExecutionBlock grandChildBlock : context.plan.getChilds(childBlock)) { StoreTableNode copy = PlannerUtil.clone(context.plan.getLogicalPlan(), currentNode); copy.setChild(grandChildBlock.getPlan()); grandChildBlock.setPlan(copy); } return childBlock; }
/** * It makes a plan to store directly union plans into a non-partitioned table. */ private ExecutionBlock buildShuffleAndStorePlanNoPartitionedTableWithUnion(GlobalPlanContext context, StoreTableNode currentNode, ExecutionBlock childBlock) throws TajoException { for (ExecutionBlock grandChildBlock : context.plan.getChilds(childBlock)) { StoreTableNode copy = PlannerUtil.clone(context.plan.getLogicalPlan(), currentNode); copy.setChild(grandChildBlock.getPlan()); grandChildBlock.setPlan(copy); } return childBlock; }
private ExecutionBlock buildNoPartitionedStorePlan(GlobalPlanContext context, StoreTableNode currentNode, ExecutionBlock childBlock) throws TajoException { if (hasUnionChild(currentNode)) { // when the below is union return buildShuffleAndStorePlanNoPartitionedTableWithUnion(context, currentNode, childBlock); } else { currentNode.setChild(childBlock.getPlan()); currentNode.setInSchema(childBlock.getPlan().getOutSchema()); childBlock.setPlan(currentNode); return childBlock; } }
private ExecutionBlock buildNoPartitionedStorePlan(GlobalPlanContext context, StoreTableNode currentNode, ExecutionBlock childBlock) throws TajoException { if (hasUnionChild(currentNode)) { // when the below is union return buildShuffleAndStorePlanNoPartitionedTableWithUnion(context, currentNode, childBlock); } else { currentNode.setChild(childBlock.getPlan()); currentNode.setInSchema(childBlock.getPlan().getOutSchema()); childBlock.setPlan(currentNode); return childBlock; } }
/** * It inserts shuffle and adds store plan on a partitioned table. */ private ExecutionBlock buildShuffleAndStorePlanToPartitionedTable(GlobalPlanContext context, StoreTableNode currentNode, ExecutionBlock lastBlock) throws TajoException { MasterPlan masterPlan = context.plan; ExecutionBlock nextBlock = masterPlan.newExecutionBlock(); DataChannel channel = new DataChannel(lastBlock, nextBlock, HASH_SHUFFLE, 32); setShuffleKeysFromPartitionedTableStore(currentNode, channel); channel.setSchema(lastBlock.getPlan().getOutSchema()); channel.setDataFormat(dataFormat); ScanNode scanNode = buildInputExecutor(masterPlan.getLogicalPlan(), channel); currentNode.setChild(scanNode); currentNode.setInSchema(scanNode.getOutSchema()); nextBlock.setPlan(currentNode); masterPlan.addConnect(channel); return nextBlock; }
/** * It inserts shuffle and adds store plan on a partitioned table. */ private ExecutionBlock buildShuffleAndStorePlanToPartitionedTable(GlobalPlanContext context, StoreTableNode currentNode, ExecutionBlock lastBlock) throws TajoException { MasterPlan masterPlan = context.plan; ExecutionBlock nextBlock = masterPlan.newExecutionBlock(); DataChannel channel = new DataChannel(lastBlock, nextBlock, HASH_SHUFFLE, 32); setShuffleKeysFromPartitionedTableStore(currentNode, channel); channel.setSchema(lastBlock.getPlan().getOutSchema()); channel.setDataFormat(dataFormat); ScanNode scanNode = buildInputExecutor(masterPlan.getLogicalPlan(), channel); currentNode.setChild(scanNode); currentNode.setInSchema(scanNode.getOutSchema()); nextBlock.setPlan(currentNode); masterPlan.addConnect(channel); return nextBlock; }
/** * It inserts shuffle and adds store plan on a partitioned table, * and it push downs those plans into child unions. */ private ExecutionBlock buildShuffleAndStorePlanToPartitionedTableWithUnion(GlobalPlanContext context, StoreTableNode currentNode, ExecutionBlock lastBlock) throws TajoException { MasterPlan masterPlan = context.plan; DataChannel lastChannel = null; for (DataChannel channel : masterPlan.getIncomingChannels(lastBlock.getId())) { ExecutionBlock childBlock = masterPlan.getExecBlock(channel.getSrcId()); setShuffleKeysFromPartitionedTableStore(currentNode, channel); channel.setSchema(childBlock.getPlan().getOutSchema()); channel.setDataFormat(dataFormat); lastChannel = channel; } ScanNode scanNode = buildInputExecutor(masterPlan.getLogicalPlan(), lastChannel); currentNode.setChild(scanNode); currentNode.setInSchema(scanNode.getOutSchema()); lastBlock.setPlan(currentNode); return lastBlock; }
/** * It inserts shuffle and adds store plan on a partitioned table, * and it push downs those plans into child unions. */ private ExecutionBlock buildShuffleAndStorePlanToPartitionedTableWithUnion(GlobalPlanContext context, StoreTableNode currentNode, ExecutionBlock lastBlock) throws TajoException { MasterPlan masterPlan = context.plan; DataChannel lastChannel = null; for (DataChannel channel : masterPlan.getIncomingChannels(lastBlock.getId())) { ExecutionBlock childBlock = masterPlan.getExecBlock(channel.getSrcId()); setShuffleKeysFromPartitionedTableStore(currentNode, channel); channel.setSchema(childBlock.getPlan().getOutSchema()); channel.setDataFormat(dataFormat); lastChannel = channel; } ScanNode scanNode = buildInputExecutor(masterPlan.getLogicalPlan(), lastChannel); currentNode.setChild(scanNode); currentNode.setInSchema(scanNode.getOutSchema()); lastBlock.setPlan(currentNode); return lastBlock; }
case STORE: StoreTableNode storeTableNode = (StoreTableNode) parentNode; storeTableNode.setChild(child); storeTableNode.setInSchema(child.getOutSchema()); break;
case STORE: StoreTableNode storeTableNode = (StoreTableNode) parentNode; storeTableNode.setChild(child); storeTableNode.setInSchema(child.getOutSchema()); break;