@Override public LogicalNode visitJoin(Set<Target> ctx, LogicalPlan plan, LogicalPlan.QueryBlock block, JoinNode node, Stack<LogicalNode> stack) throws TajoException { super.visitJoin(ctx, plan, block, node, stack); if (node.hasTargets()) { for (Target target : node.getTargets()) { ctx.add(target); } } return node; } }
@Override public LogicalNode visitJoin(Set<Target> ctx, LogicalPlan plan, LogicalPlan.QueryBlock block, JoinNode node, Stack<LogicalNode> stack) throws TajoException { super.visitJoin(ctx, plan, block, node, stack); if (node.hasTargets()) { for (Target target : node.getTargets()) { ctx.add(target); } } return node; } }
@Override public LogicalNode visitJoin(PlanShapeFixerContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, JoinNode node, Stack<LogicalNode> stack) throws TajoException { super.visitJoin(context, plan, block, node, stack); int rightChildNum = context.childNumbers.pop(); int leftChildNum = context.childNumbers.pop(); if (node.hasTargets()) { node.setTargets(sortTargets(node.getTargets())); } if (node.hasJoinQual()) { node.setJoinQual(sortQual(node.getJoinQual())); } context.childNumbers.push(rightChildNum + leftChildNum); return null; }
@Override public LogicalNode visitJoin(PlanShapeFixerContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, JoinNode node, Stack<LogicalNode> stack) throws TajoException { super.visitJoin(context, plan, block, node, stack); int rightChildNum = context.childNumbers.pop(); int leftChildNum = context.childNumbers.pop(); if (node.hasTargets()) { node.setTargets(sortTargets(node.getTargets())); } if (node.hasJoinQual()) { node.setJoinQual(sortQual(node.getJoinQual())); } context.childNumbers.push(rightChildNum + leftChildNum); return null; }
@Override public LogicalNode visitJoin(SerializeContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, JoinNode join, Stack<LogicalNode> stack) throws TajoException { super.visitJoin(context, plan, block, join, stack); int [] childIds = registerGetChildIds(context, join); // building itself PlanProto.JoinNode.Builder joinBuilder = PlanProto.JoinNode.newBuilder(); joinBuilder.setJoinType(convertJoinType(join.getJoinType())); joinBuilder.setLeftChildSeq(childIds[0]); joinBuilder.setRightChilSeq(childIds[1]); if (join.hasJoinQual()) { joinBuilder.setJoinQual(EvalNodeSerializer.serialize(join.getJoinQual())); } if (join.hasTargets()) { joinBuilder.setExistsTargets(true); joinBuilder.addAllTargets(ProtoUtil.<PlanProto.Target>toProtoObjects(join.getTargets().toArray(new ProtoObject[join.getTargets().size()]))); } else { joinBuilder.setExistsTargets(false); } PlanProto.LogicalNode.Builder nodeBuilder = createNodeBuilder(context, join); nodeBuilder.setJoin(joinBuilder); context.treeBuilder.addNodes(nodeBuilder); return join; }
referenceNames = new String[node.getTargets().length]; int i = 0; for (Iterator<Target> it = getFilteredTarget(node.getTargets(), context.requiredSet); it.hasNext();) { Target target = it.next(); referenceNames[i++] = newContext.addExpr(target);
referenceNames = new String[node.getTargets().size()]; int i = 0; for (Iterator<Target> it = getFilteredTarget(node.getTargets(), context.requiredSet); it.hasNext();) { Target target = it.next(); referenceNames[i++] = newContext.addExpr(target);
this.projector = new Projector(context, inSchema, outSchema, plan.getTargets());
this.projector = new Projector(context, inSchema, outSchema, plan.getTargets());
@Override public LogicalNode visitJoin(SerializeContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, JoinNode join, Stack<LogicalNode> stack) throws TajoException { super.visitJoin(context, plan, block, join, stack); int [] childIds = registerGetChildIds(context, join); // building itself PlanProto.JoinNode.Builder joinBuilder = PlanProto.JoinNode.newBuilder(); joinBuilder.setJoinType(convertJoinType(join.getJoinType())); joinBuilder.setLeftChildSeq(childIds[0]); joinBuilder.setRightChilSeq(childIds[1]); if (join.hasJoinQual()) { joinBuilder.setJoinQual(EvalNodeSerializer.serialize(join.getJoinQual())); } if (join.hasTargets()) { joinBuilder.setExistsTargets(true); joinBuilder.addAllTargets(ProtoUtil.<PlanProto.Target>toProtoObjects(join.getTargets())); } else { joinBuilder.setExistsTargets(false); } PlanProto.LogicalNode.Builder nodeBuilder = createNodeBuilder(context, join); nodeBuilder.setJoin(joinBuilder); context.treeBuilder.addNodes(nodeBuilder); return join; }