@Override public LogicalNode visitProjection(CompilationContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, ProjectionNode node, Stack<LogicalNode> stack) throws TajoException { super.visitProjection(context, plan, block, node, stack); compileProjectableNode(context, node.getInSchema(), node); return node; }
@Override public LogicalNode visitProjection(CompilationContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, ProjectionNode node, Stack<LogicalNode> stack) throws TajoException { super.visitProjection(context, plan, block, node, stack); compileProjectableNode(context, node.getInSchema(), node); return node; }
@Override public PlanString getPlanString() { PlanString planStr = new PlanString(this); if (distinct) { planStr.appendTitle(" (distinct)"); } StringBuilder sb = new StringBuilder("Targets: "); if (targets != null) { for (int i = 0; i < targets.size(); i++) { sb.append(targets.get(i)); if (i < targets.size() - 1) { sb.append(", "); } } } planStr.addExplan(sb.toString()); if (getOutSchema() != null) { planStr.addExplan("out schema: " + getOutSchema().toString()); } if (getInSchema() != null) { planStr.addExplan("in schema: " + getInSchema().toString()); } return planStr; } }
@Override public PlanString getPlanString() { PlanString planStr = new PlanString(this); if (distinct) { planStr.appendTitle(" (distinct)"); } StringBuilder sb = new StringBuilder("Targets: "); if (targets != null) { for (int i = 0; i < targets.length; i++) { sb.append(targets[i]); if (i < targets.length - 1) { sb.append(", "); } } } planStr.addExplan(sb.toString()); if (getOutSchema() != null) { planStr.addExplan("out schema: " + getOutSchema().toString()); } if (getInSchema() != null) { planStr.addExplan("in schema: " + getInSchema().toString()); } return planStr; } }
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()); } }
dupRemoval.setForDistinctBlock(); dupRemoval.setChild(child); dupRemoval.setInSchema(projectionNode.getInSchema()); dupRemoval.setTargets(PlannerUtil.schemaToTargets(outSchema)); dupRemoval.setGroupingColumns(outSchema.toArray());
dupRemoval.setForDistinctBlock(); dupRemoval.setChild(child); dupRemoval.setInSchema(projectionNode.getInSchema()); dupRemoval.setTargets(PlannerUtil.schemaToTargets(outSchema)); dupRemoval.setGroupingColumns(outSchema.toArray());