public int hashCode() { return Objects.hashCode(distinct, getLeft(), getRight()); }
public int hashCode() { return Objects.hashCode(distinct, getLeft(), getRight()); }
@Override public LogicalNode visitIntersect(ProcessorContext ctx, Stack<Expr> stack, SetOperation expr) throws TajoException { super.visitIntersect(ctx, stack, expr); IntersectNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getLeft()); node.setInSchema(child.getOutSchema()); node.setOutSchema(node.getInSchema()); return node; }
@Override public LogicalNode visitExcept(ProcessorContext ctx, Stack<Expr> stack, SetOperation expr) throws TajoException { super.visitExcept(ctx, stack, expr); ExceptNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getLeft()); node.setInSchema(child.getOutSchema()); node.setOutSchema(node.getInSchema()); return node; }
@Override public LogicalNode visitIntersect(ProcessorContext ctx, Stack<Expr> stack, SetOperation expr) throws TajoException { super.visitIntersect(ctx, stack, expr); IntersectNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getLeft()); node.setInSchema(child.getOutSchema()); node.setOutSchema(node.getInSchema()); return node; }
@Override public LogicalNode visitUnion(ProcessorContext ctx, Stack<Expr> stack, SetOperation expr) throws TajoException { super.visitUnion(ctx, stack, expr); UnionNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getLeft()); node.setInSchema(child.getOutSchema()); node.setOutSchema(node.getInSchema()); return node; }
@Override public LogicalNode visitExcept(ProcessorContext ctx, Stack<Expr> stack, SetOperation expr) throws TajoException { super.visitExcept(ctx, stack, expr); ExceptNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getLeft()); node.setInSchema(child.getOutSchema()); node.setOutSchema(node.getInSchema()); return node; }
@Override public LogicalNode visitUnion(ProcessorContext ctx, Stack<Expr> stack, SetOperation expr) throws TajoException { super.visitUnion(ctx, stack, expr); UnionNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getLeft()); node.setInSchema(child.getOutSchema()); node.setOutSchema(node.getInSchema()); return node; }
@Override public LogicalNode visitUnion(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, SetOperation expr) throws TajoException { LogicalPlan.QueryBlock leftBlock = ctx.getPlan().newQueryBlock(); LogicalPlanner.PlanContext leftContext = new LogicalPlanner.PlanContext(ctx, leftBlock); LogicalNode leftChild = visit(leftContext, new Stack<>(), expr.getLeft()); leftBlock.setRoot(leftChild); ctx.getQueryBlock().registerExprWithNode(expr.getLeft(), leftChild); LogicalPlan.QueryBlock rightBlock = ctx.getPlan().newQueryBlock(); LogicalPlanner.PlanContext rightContext = new LogicalPlanner.PlanContext(ctx, rightBlock); LogicalNode rightChild = visit(rightContext, new Stack<>(), expr.getRight()); rightBlock.setRoot(rightChild); ctx.getQueryBlock().registerExprWithNode(expr.getRight(), rightChild); UnionNode unionNode = new UnionNode(ctx.getPlan().newPID()); unionNode.setLeftChild(leftChild); unionNode.setRightChild(rightChild); unionNode.setInSchema(leftChild.getOutSchema()); unionNode.setOutSchema(leftChild.getOutSchema()); unionNode.setDistinct(expr.isDistinct()); return unionNode; }
@Override public LogicalNode visitUnion(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, SetOperation expr) throws TajoException { LogicalPlan.QueryBlock leftBlock = ctx.getPlan().newQueryBlock(); LogicalPlanner.PlanContext leftContext = new LogicalPlanner.PlanContext(ctx, leftBlock); LogicalNode leftChild = visit(leftContext, new Stack<Expr>(), expr.getLeft()); leftBlock.setRoot(leftChild); ctx.getQueryBlock().registerExprWithNode(expr.getLeft(), leftChild); LogicalPlan.QueryBlock rightBlock = ctx.getPlan().newQueryBlock(); LogicalPlanner.PlanContext rightContext = new LogicalPlanner.PlanContext(ctx, rightBlock); LogicalNode rightChild = visit(rightContext, new Stack<Expr>(), expr.getRight()); rightBlock.setRoot(rightChild); ctx.getQueryBlock().registerExprWithNode(expr.getRight(), rightChild); UnionNode unionNode = new UnionNode(ctx.getPlan().newPID()); unionNode.setLeftChild(leftChild); unionNode.setRightChild(rightChild); unionNode.setInSchema(leftChild.getOutSchema()); unionNode.setOutSchema(leftChild.getOutSchema()); unionNode.setDistinct(expr.isDistinct()); return unionNode; }