@Override public RESULT visitHaving(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode node, Stack<LogicalNode> stack) throws TajoException { stack.push(node); RESULT result = visit(context, plan, block, node.getChild(), stack); stack.pop(); return result; }
public HavingExec(TaskAttemptContext context, HavingNode plan, PhysicalExec child) { super(context, plan.getInSchema(), plan.getOutSchema(), child); this.qual = plan.getQual(); }
private static HavingNode convertHaving(OverridableConf context, EvalContext evalContext, Map<Integer, LogicalNode> nodeMap, PlanProto.LogicalNode protoNode) { PlanProto.FilterNode havingProto = protoNode.getFilter(); HavingNode having = new HavingNode(protoNode.getNodeId()); having.setChild(nodeMap.get(havingProto.getChildSeq())); having.setQual(EvalNodeDeserializer.deserialize(context, evalContext, havingProto.getQual())); having.setInSchema(convertSchema(protoNode.getInSchema())); having.setOutSchema(convertSchema(protoNode.getOutSchema())); return having; }
@Override public LogicalNode visitHaving(GlobalPlanContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode node, Stack<LogicalNode> stack) throws TajoException { LogicalNode child = super.visitHaving(context, plan, block, node, stack); // Don't separate execution block. Having is pushed to the second grouping execution block. ExecutionBlock childBlock = context.execBlockMap.remove(child.getPID()); node.setChild(childBlock.getPlan()); childBlock.setPlan(node); context.execBlockMap.put(node.getPID(), childBlock); return node; }
@Override public LogicalNode visitHaving(Context context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode node, Stack<LogicalNode> stack) throws TajoException { Context newContext = new Context(context); String referenceName = newContext.targetListMgr.add(node.getQual()); newContext.addNecessaryReferences(node.getQual()); LogicalNode child = super.visitHaving(newContext, plan, block, node, stack); node.setInSchema(child.getOutSchema()); node.setOutSchema(child.getOutSchema()); Target target = context.targetListMgr.getTarget(referenceName); if (newContext.targetListMgr.isEvaluated(referenceName)) { node.setQual(new FieldEval(target.getNamedColumn())); } else { node.setQual(target.getEvalTree()); newContext.targetListMgr.markAsEvaluated(target); } return node; }
if (havingNode != null) { workingHavingNode = havingNode; aggrEvals.add(havingNode.getQual()); } else { workingHavingNode = plan.createNode(HavingNode.class); block.registerNode(workingHavingNode); parentNode.setChild(workingHavingNode); workingHavingNode.setChild(groupByNode); workingHavingNode.setQual(qual);
@Override public LogicalNode visitHaving(ProcessorContext ctx, Stack<Expr> stack, Having expr) throws TajoException { super.visitHaving(ctx, stack, expr); HavingNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getChild()); node.setInSchema(child.getOutSchema()); node.setOutSchema(node.getInSchema()); return node; }
@Override public LogicalNode visitHaving(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, Having expr) throws TajoException { stack.push(expr); LogicalNode child = visit(ctx, stack, expr.getChild()); stack.pop(); HavingNode havingNode = ctx.getPlan().createNode(HavingNode.class); havingNode.setInSchema(child.getOutSchema()); havingNode.setOutSchema(child.getOutSchema()); return havingNode; }
@Override public LogicalNode visitHaving(CompilationContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode node, Stack<LogicalNode> stack) throws TajoException { super.visitHaving(context, plan, block, node, stack); compileSelectableNode(context, node.getInSchema(), node); return node; }
@Override public LogicalNode visitHaving(SerializeContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode having, Stack<LogicalNode> stack) throws TajoException { super.visitHaving(context, plan, block, having, stack); int [] childIds = registerGetChildIds(context, having); PlanProto.FilterNode.Builder filterBuilder = PlanProto.FilterNode.newBuilder(); filterBuilder.setChildSeq(childIds[0]); filterBuilder.setQual(EvalNodeSerializer.serialize(having.getQual())); PlanProto.LogicalNode.Builder nodeBuilder = createNodeBuilder(context, having); nodeBuilder.setFilter(filterBuilder); context.treeBuilder.addNodes(nodeBuilder); return having; }
@Override public LogicalNode visitHaving(Context context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode node, Stack<LogicalNode> stack) throws TajoException { Context newContext = new Context(context); String referenceName = newContext.targetListMgr.add(node.getQual()); newContext.addNecessaryReferences(node.getQual()); LogicalNode child = super.visitHaving(newContext, plan, block, node, stack); node.setInSchema(child.getOutSchema()); node.setOutSchema(child.getOutSchema()); Target target = context.targetListMgr.getTarget(referenceName); if (newContext.targetListMgr.isEvaluated(referenceName)) { node.setQual(new FieldEval(target.getNamedColumn())); } else { node.setQual(target.getEvalTree()); newContext.targetListMgr.markAsEvaluated(target); } return node; }
if (havingNode != null) { workingHavingNode = havingNode; aggrEvals.add(havingNode.getQual()); } else { workingHavingNode = plan.createNode(HavingNode.class); block.registerNode(workingHavingNode); parentNode.setChild(workingHavingNode); workingHavingNode.setChild(groupByNode); workingHavingNode.setQual(qual);
@Override public LogicalNode visitHaving(ProcessorContext ctx, Stack<Expr> stack, Having expr) throws TajoException { super.visitHaving(ctx, stack, expr); HavingNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getChild()); node.setInSchema(child.getOutSchema()); node.setOutSchema(node.getInSchema()); return node; }
@Override public LogicalNode visitHaving(GlobalPlanContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode node, Stack<LogicalNode> stack) throws TajoException { LogicalNode child = super.visitHaving(context, plan, block, node, stack); // Don't separate execution block. Having is pushed to the second grouping execution block. ExecutionBlock childBlock = context.execBlockMap.remove(child.getPID()); node.setChild(childBlock.getPlan()); childBlock.setPlan(node); context.execBlockMap.put(node.getPID(), childBlock); return node; }
@Override public LogicalNode visitHaving(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, Having expr) throws TajoException { stack.push(expr); LogicalNode child = visit(ctx, stack, expr.getChild()); stack.pop(); HavingNode havingNode = ctx.getPlan().createNode(HavingNode.class); havingNode.setInSchema(child.getOutSchema()); havingNode.setOutSchema(child.getOutSchema()); return havingNode; }
@Override public LogicalNode visitHaving(CompilationContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode node, Stack<LogicalNode> stack) throws TajoException { super.visitHaving(context, plan, block, node, stack); compileSelectableNode(context, node.getInSchema(), node); return node; }
@Override public LogicalNode visitHaving(SerializeContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode having, Stack<LogicalNode> stack) throws TajoException { super.visitHaving(context, plan, block, having, stack); int [] childIds = registerGetChildIds(context, having); PlanProto.FilterNode.Builder filterBuilder = PlanProto.FilterNode.newBuilder(); filterBuilder.setChildSeq(childIds[0]); filterBuilder.setQual(EvalNodeSerializer.serialize(having.getQual())); PlanProto.LogicalNode.Builder nodeBuilder = createNodeBuilder(context, having); nodeBuilder.setFilter(filterBuilder); context.treeBuilder.addNodes(nodeBuilder); return having; }
private static HavingNode convertHaving(OverridableConf context, EvalContext evalContext, Map<Integer, LogicalNode> nodeMap, PlanProto.LogicalNode protoNode) { PlanProto.FilterNode havingProto = protoNode.getFilter(); HavingNode having = new HavingNode(protoNode.getNodeId()); having.setChild(nodeMap.get(havingProto.getChildSeq())); having.setQual(EvalNodeDeserializer.deserialize(context, evalContext, havingProto.getQual())); having.setInSchema(convertSchema(protoNode.getInSchema())); having.setOutSchema(convertSchema(protoNode.getOutSchema())); return having; }
public HavingExec(TaskAttemptContext context, HavingNode plan, PhysicalExec child) { super(context, plan.getInSchema(), plan.getOutSchema(), child); this.qual = plan.getQual(); }
@Override public RESULT visitHaving(CONTEXT context, LogicalPlan plan, LogicalPlan.QueryBlock block, HavingNode node, Stack<LogicalNode> stack) throws TajoException { stack.push(node); RESULT result = visit(context, plan, block, node.getChild(), stack); stack.pop(); return result; }