@Override public LogicalNode visitRoot(Context context, LogicalPlan plan, LogicalPlan.QueryBlock block, LogicalRootNode node, Stack<LogicalNode> stack) throws TajoException { LogicalNode child = super.visitRoot(context, plan, block, node, stack); node.setInSchema(child.getOutSchema()); node.setOutSchema(child.getOutSchema()); return node; }
public LogicalNode visitLimit(Context context, LogicalPlan plan, LogicalPlan.QueryBlock block, LimitNode node, Stack<LogicalNode> stack) throws TajoException { LogicalNode child = super.visitLimit(context, plan, block, node, stack); node.setInSchema(child.getOutSchema()); node.setOutSchema(child.getOutSchema()); return node; }
public static boolean isNonEquiThetaJoinQual(final LogicalPlan.QueryBlock block, final JoinNode joinNode, final EvalNode evalNode) { if (EvalTreeUtil.isJoinQual(block, joinNode.getLeftChild().getOutSchema(), joinNode.getRightChild().getOutSchema(), evalNode, true) && evalNode.getType() != EvalType.EQUAL) { return true; } else { return false; } }
private static boolean isNonEquiThetaJoinQual(final LogicalPlan.QueryBlock block, final JoinNode joinNode, final EvalNode evalNode) { if (EvalTreeUtil.isJoinQual(block, joinNode.getLeftChild().getOutSchema(), joinNode.getRightChild().getOutSchema(), evalNode, true) && evalNode.getType() != EvalType.EQUAL) { return true; } else { return false; } }
@Override public LogicalNode visitCreateIndex(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, CreateIndex expr) throws TajoException { stack.push(expr); LogicalNode child = visit(ctx, stack, expr.getChild()); stack.pop(); CreateIndexNode createIndex = ctx.getPlan().createNode(CreateIndexNode.class); createIndex.setInSchema(child.getOutSchema()); createIndex.setOutSchema(child.getOutSchema()); return createIndex; }
public LogicalNode visitInsert(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, Insert expr) throws TajoException { LogicalNode child = super.visitInsert(ctx, stack, expr); InsertNode insertNode = new InsertNode(ctx.getPlan().newPID()); insertNode.setInSchema(child.getOutSchema()); insertNode.setOutSchema(child.getOutSchema()); return insertNode; }
public LogicalNode visitInsert(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, Insert expr) throws TajoException { LogicalNode child = super.visitInsert(ctx, stack, expr); InsertNode insertNode = new InsertNode(ctx.getPlan().newPID()); insertNode.setInSchema(child.getOutSchema()); insertNode.setOutSchema(child.getOutSchema()); return insertNode; }
@Override public LogicalNode visit(PlanShapeFixerContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, LogicalNode node, Stack<LogicalNode> stack) throws TajoException { super.visit(context, plan, block, node, stack); node.setInSchema(sortSchema(node.getInSchema())); node.setOutSchema(sortSchema(node.getOutSchema())); context.childNumbers.push(context.childNumbers.pop() + 1); return null; }
public void setSubQuery(LogicalNode node) { this.subQuery = node; setInSchema(SchemaUtil.clone(this.subQuery.getOutSchema())); getInSchema().setQualifier(this.tableName); if (hasTargets()) { setOutSchema(PlannerUtil.targetToSchema(targets)); } else { setOutSchema(SchemaUtil.clone(this.subQuery.getOutSchema())); } }
@Override public LogicalNode visitFilter(GlobalPlanContext context, LogicalPlan plan, LogicalPlan.QueryBlock block, SelectionNode node, Stack<LogicalNode> stack) throws TajoException { LogicalNode child = super.visitFilter(context, plan, block, node, stack); ExecutionBlock execBlock = context.execBlockMap.remove(child.getPID()); node.setChild(execBlock.getPlan()); node.setInSchema(execBlock.getPlan().getOutSchema()); execBlock.setPlan(node); context.execBlockMap.put(node.getPID(), execBlock); return node; }
@Override public LogicalNode visitCreateTable(Context context, LogicalPlan plan, LogicalPlan.QueryBlock block, CreateTableNode node, Stack<LogicalNode> stack) throws TajoException { super.visitCreateTable(context, plan, block, node, stack); // here, we don't need check table existence because this check is performed in PreLogicalPlanVerifier. if (node.hasSubQuery()) { ensureDomains(context.state, node.getLogicalSchema(), node.getChild(0).getOutSchema()); } return node; }
private PhysicalExec buildOutputOperator(TaskAttemptContext context, LogicalNode plan, PhysicalExec execPlan) throws IOException { DataChannel channel = context.getDataChannel(); ShuffleFileWriteNode shuffleFileWriteNode = LogicalPlan.createNodeWithoutPID(ShuffleFileWriteNode.class); shuffleFileWriteNode.setDataFormat(context.getDataChannel().getDataFormat()); shuffleFileWriteNode.setInSchema(plan.getOutSchema()); shuffleFileWriteNode.setOutSchema(plan.getOutSchema()); shuffleFileWriteNode.setShuffle(channel.getShuffleType(), channel.getShuffleKeys(), channel.getShuffleOutputNum()); shuffleFileWriteNode.setChild(plan); PhysicalExec outExecPlan = createShuffleFileWritePlan(context, shuffleFileWriteNode, execPlan); return outExecPlan; }
@Override public LogicalNode visitGroupBy(ProcessorContext ctx, Stack<Expr> stack, Aggregation expr) throws TajoException { super.visitGroupBy(ctx, stack, expr); GroupbyNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getChild()); node.setInSchema(child.getOutSchema()); return node; }
private ExecutionBlock buildNoPartitionedStorePlan(GlobalPlanContext context, StoreTableNode currentNode, ExecutionBlock childBlock) throws TajoException { if (hasUnionChild(currentNode)) { // when the below is union return buildShuffleAndStorePlanNoPartitionedTableWithUnion(context, currentNode, childBlock); } else { currentNode.setChild(childBlock.getPlan()); currentNode.setInSchema(childBlock.getPlan().getOutSchema()); childBlock.setPlan(currentNode); return childBlock; } }
@Override public LogicalNode visitInsert(ProcessorContext ctx, Stack<Expr> stack, Insert expr) throws TajoException { super.visitInsert(ctx, stack, expr); InsertNode node = getNodeFromExpr(ctx.planContext.getPlan(), expr); LogicalNode child = getNonRelationListExpr(ctx.planContext.getPlan(), expr.getSubQuery()); node.setInSchema(child.getOutSchema()); node.setOutSchema(node.getInSchema()); return node; }
@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 visitLimit(ProcessorContext ctx, Stack<Expr> stack, Limit expr) throws TajoException { super.visitLimit(ctx, stack, expr); LimitNode 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 visitSort(ProcessorContext ctx, Stack<Expr> stack, Sort expr) throws TajoException { super.visitSort(ctx, stack, expr); SortNode 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(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 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; }