groupbyNode.setChild(child); groupbyNode.setInSchema(child.getOutSchema());
groupbyNode.setChild(child); groupbyNode.setInSchema(child.getOutSchema());
groupingNode.setChild(child); groupingNode.setInSchema(child.getOutSchema());
groupingNode.setChild(child); groupingNode.setInSchema(child.getOutSchema());
firstStageGroupby.setAggFunctions(firstStageAggFunctions); firstStageGroupby.setTargets(firstStageTargets); firstStageGroupby.setChild(groupbyNode.getChild()); firstStageGroupby.setInSchema(groupbyNode.getInSchema()); secondPhaseGroupby.setChild(scanNode); secondPhaseGroupby.setInSchema(scanNode.getOutSchema()); secondStage.setPlan(secondPhaseGroupby);
firstStageGroupby.setAggFunctions(TUtil.toArray(firstStageAggFunctions, AggregationFunctionCallEval.class)); firstStageGroupby.setTargets(firstStageTargets); firstStageGroupby.setChild(groupbyNode.getChild()); firstStageGroupby.setInSchema(groupbyNode.getInSchema()); secondPhaseGroupby.setChild(scanNode); secondPhaseGroupby.setInSchema(scanNode.getOutSchema()); secondStage.setPlan(secondPhaseGroupby);
private void insertDistinctOperator(LogicalPlan plan, LogicalPlan.QueryBlock block, ProjectionNode projectionNode, LogicalNode child) throws TajoException { if (projectionNode.getChild().getType() != NodeType.GROUP_BY) { Schema outSchema = projectionNode.getOutSchema(); GroupbyNode dupRemoval = plan.createNode(GroupbyNode.class); dupRemoval.setChild(child); dupRemoval.setInSchema(projectionNode.getInSchema()); dupRemoval.setTargets(PlannerUtil.schemaToTargets(outSchema)); dupRemoval.setGroupingColumns(outSchema.toArray()); block.registerNode(dupRemoval); block.setAggregationRequire(); projectionNode.setChild(dupRemoval); projectionNode.setInSchema(dupRemoval.getOutSchema()); } }
private void insertDistinctOperator(LogicalPlan plan, LogicalPlan.QueryBlock block, ProjectionNode projectionNode, LogicalNode child) throws TajoException { if (projectionNode.getChild().getType() != NodeType.GROUP_BY) { Schema outSchema = projectionNode.getOutSchema(); GroupbyNode dupRemoval = plan.createNode(GroupbyNode.class); dupRemoval.setChild(child); dupRemoval.setInSchema(projectionNode.getInSchema()); dupRemoval.setTargets(PlannerUtil.schemaToTargets(outSchema)); dupRemoval.setGroupingColumns(outSchema.toArray()); block.registerNode(dupRemoval); block.setAggregationRequire(); projectionNode.setChild(dupRemoval); projectionNode.setInSchema(dupRemoval.getOutSchema()); } }
private static GroupbyNode convertGroupby(OverridableConf context, EvalContext evalContext, Map<Integer, LogicalNode> nodeMap, PlanProto.LogicalNode protoNode) { PlanProto.GroupbyNode groupbyProto = protoNode.getGroupby(); GroupbyNode groupby = new GroupbyNode(protoNode.getNodeId()); groupby.setChild(nodeMap.get(groupbyProto.getChildSeq())); groupby.setDistinct(groupbyProto.getDistinct()); if (groupbyProto.getGroupingKeysCount() > 0) { groupby.setGroupingColumns(convertColumns(groupbyProto.getGroupingKeysList())); } if (groupbyProto.getAggFunctionsCount() > 0) { groupby.setAggFunctions(convertAggFuncCallEvals(context, evalContext, groupbyProto.getAggFunctionsList())); } if (groupbyProto.getTargetsCount() > 0) { groupby.setTargets(convertTargets(context, evalContext, groupbyProto.getTargetsList())); } groupby.setInSchema(convertSchema(protoNode.getInSchema())); groupby.setOutSchema(convertSchema(protoNode.getOutSchema())); return groupby; }
private static GroupbyNode convertGroupby(OverridableConf context, EvalContext evalContext, Map<Integer, LogicalNode> nodeMap, PlanProto.LogicalNode protoNode) { PlanProto.GroupbyNode groupbyProto = protoNode.getGroupby(); GroupbyNode groupby = new GroupbyNode(protoNode.getNodeId()); groupby.setChild(nodeMap.get(groupbyProto.getChildSeq())); groupby.setDistinct(groupbyProto.getDistinct()); if (groupbyProto.getGroupingKeysCount() > 0) { groupby.setGroupingColumns(convertColumns(groupbyProto.getGroupingKeysList())); } if (groupbyProto.getAggFunctionsCount() > 0) { groupby.setAggFunctions(convertAggFuncCallEvals(context, evalContext, groupbyProto.getAggFunctionsList())); } if (groupbyProto.getTargetsCount() > 0) { groupby.setTargets(convertTargets(context, evalContext, groupbyProto.getTargetsList())); } groupby.setInSchema(convertSchema(protoNode.getInSchema())); groupby.setOutSchema(convertSchema(protoNode.getOutSchema())); return groupby; }
private ExecutionBlock buildTwoPhaseGroupby(MasterPlan masterPlan, ExecutionBlock latestBlock, GroupbyNode firstPhaseGroupby, GroupbyNode secondPhaseGroupby) throws TajoException { ExecutionBlock childBlock = latestBlock; childBlock.setPlan(firstPhaseGroupby); ExecutionBlock currentBlock = masterPlan.newExecutionBlock(); DataChannel channel; if (firstPhaseGroupby.isEmptyGrouping()) { channel = new DataChannel(childBlock, currentBlock, HASH_SHUFFLE, 1); channel.setShuffleKeys(firstPhaseGroupby.getGroupingColumns()); } else { channel = new DataChannel(childBlock, currentBlock, HASH_SHUFFLE, 32); channel.setShuffleKeys(firstPhaseGroupby.getGroupingColumns()); } channel.setSchema(firstPhaseGroupby.getOutSchema()); channel.setDataFormat(dataFormat); ScanNode scanNode = buildInputExecutor(masterPlan.getLogicalPlan(), channel); secondPhaseGroupby.setChild(scanNode); secondPhaseGroupby.setInSchema(scanNode.getOutSchema()); currentBlock.setPlan(secondPhaseGroupby); masterPlan.addConnect(channel); return currentBlock; }
private ExecutionBlock buildTwoPhaseGroupby(MasterPlan masterPlan, ExecutionBlock latestBlock, GroupbyNode firstPhaseGroupby, GroupbyNode secondPhaseGroupby) throws TajoException { ExecutionBlock childBlock = latestBlock; childBlock.setPlan(firstPhaseGroupby); ExecutionBlock currentBlock = masterPlan.newExecutionBlock(); DataChannel channel; if (firstPhaseGroupby.isEmptyGrouping()) { channel = new DataChannel(childBlock, currentBlock, HASH_SHUFFLE, 1); channel.setShuffleKeys(firstPhaseGroupby.getGroupingColumns()); } else { channel = new DataChannel(childBlock, currentBlock, HASH_SHUFFLE, 32); channel.setShuffleKeys(firstPhaseGroupby.getGroupingColumns()); } channel.setSchema(firstPhaseGroupby.getOutSchema()); channel.setDataFormat(dataFormat); ScanNode scanNode = buildInputExecutor(masterPlan.getLogicalPlan(), channel); secondPhaseGroupby.setChild(scanNode); secondPhaseGroupby.setInSchema(scanNode.getOutSchema()); currentBlock.setPlan(secondPhaseGroupby); masterPlan.addConnect(channel); return currentBlock; }
dupRemoval.setChild(sortNode.getChild()); dupRemoval.setInSchema(sortNode.getInSchema()); dupRemoval.setTargets(PlannerUtil.schemaToTargets(sortNode.getInSchema())); GroupbyNode dupRemoval = context.plan.createNode(GroupbyNode.class); dupRemoval.setForDistinctBlock(); dupRemoval.setChild(child); dupRemoval.setInSchema(projectionNode.getInSchema()); dupRemoval.setTargets(PlannerUtil.schemaToTargets(outSchema));
dupRemoval.setChild(sortNode.getChild()); dupRemoval.setInSchema(sortNode.getInSchema()); dupRemoval.setTargets(PlannerUtil.schemaToTargets(sortNode.getInSchema())); GroupbyNode dupRemoval = context.plan.createNode(GroupbyNode.class); dupRemoval.setForDistinctBlock(); dupRemoval.setChild(child); dupRemoval.setInSchema(projectionNode.getInSchema()); dupRemoval.setTargets(PlannerUtil.schemaToTargets(outSchema));
CatalogUtil.newTableMeta(BuiltinStorages.TEXT, conf), new Path("in2"))); groupbyNode.setChild(scanNode); groupbyNode2.setChild(joinNode); joinNode.setLeftChild(scanNode); joinNode.setRightChild(scanNode2); scanNode3.init(CatalogUtil.newTableDesc("in", schema, CatalogUtil.newTableMeta(BuiltinStorages.TEXT, conf), new Path("in"))); groupbyNode2.setChild(scanNode3);
setOpGroupbyNode.setGroupingColumns(setOpSchema.toArray()); setOpGroupbyNode.setTargets(setOpTarget); setOpGroupbyNode.setChild(setOpTableSubQueryNode); currentBlock.registerNode(setOpGroupbyNode);
setOpGroupbyNode.setGroupingColumns(setOpSchema.toArray()); setOpGroupbyNode.setTargets(setOpTarget); setOpGroupbyNode.setChild(setOpTableSubQueryNode); currentBlock.registerNode(setOpGroupbyNode);