@Override public LogicalNode visitSetSession(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, SetSession expr) throws TajoException { SetSessionNode setSession = ctx.getPlan().createNode(SetSessionNode.class); return setSession; }
@Override public LogicalNode visitSetSession(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, SetSession expr) throws TajoException { SetSessionNode setSession = ctx.getPlan().createNode(SetSessionNode.class); return setSession; }
@Override public LogicalNode visitDropIndex(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, DropIndex expr) { return ctx.getPlan().createNode(DropIndexNode.class); }
@Override public LogicalNode visitCreateDatabase(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, CreateDatabase expr) throws TajoException { CreateDatabaseNode createDatabaseNode = ctx.getPlan().createNode(CreateDatabaseNode.class); return createDatabaseNode; }
@Override public LogicalNode visitDropDatabase(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, DropDatabase expr) throws TajoException { DropDatabaseNode dropDatabaseNode = ctx.getPlan().createNode(DropDatabaseNode.class); return dropDatabaseNode; }
@Override public LogicalNode visitAlterTable(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, AlterTable expr) throws TajoException { AlterTableNode alterTableNode = ctx.getPlan().createNode(AlterTableNode.class); return alterTableNode; }
@Override public LogicalNode visitDropTable(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, DropTable expr) throws TajoException { DropTableNode dropTable = ctx.getPlan().createNode(DropTableNode.class); return dropTable; }
@Override public LogicalNode visitCreateDatabase(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, CreateDatabase expr) throws TajoException { CreateDatabaseNode createDatabaseNode = ctx.getPlan().createNode(CreateDatabaseNode.class); return createDatabaseNode; }
@Override public LogicalNode visitDropDatabase(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, DropDatabase expr) throws TajoException { DropDatabaseNode dropDatabaseNode = ctx.getPlan().createNode(DropDatabaseNode.class); return dropDatabaseNode; }
@Override public LogicalNode visitDropTable(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, DropTable expr) throws TajoException { DropTableNode dropTable = ctx.getPlan().createNode(DropTableNode.class); return dropTable; }
@Override public LogicalNode visitAlterTable(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, AlterTable expr) throws TajoException { AlterTableNode alterTableNode = ctx.getPlan().createNode(AlterTableNode.class); return alterTableNode; }
@Override public LogicalNode visitDropIndex(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, DropIndex expr) { return ctx.getPlan().createNode(DropIndexNode.class); }
@Override public LogicalNode visitAlterTablespace(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, AlterTablespace expr) throws TajoException { AlterTablespaceNode alterTablespace = ctx.getPlan().createNode(AlterTablespaceNode.class); return alterTablespace; }
@Override public LogicalNode visitCreateTable(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, CreateTable expr) throws TajoException { CreateTableNode createTableNode = ctx.getPlan().createNode(CreateTableNode.class); if (expr.hasSubQuery()) { stack.push(expr); visit(ctx, stack, expr.getSubQuery()); stack.pop(); } return createTableNode; }
@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; }
@Override public LogicalNode visitSort(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, Sort expr) throws TajoException { stack.push(expr); LogicalNode child = visit(ctx, stack, expr.getChild()); stack.pop(); SortNode sortNode = ctx.getPlan().createNode(SortNode.class); sortNode.setInSchema(child.getOutSchema()); sortNode.setOutSchema(child.getOutSchema()); return sortNode; }
@Override public LogicalNode visitLimit(LogicalPlanner.PlanContext ctx, Stack<Expr> stack, Limit expr) throws TajoException { stack.push(expr); LogicalNode child = visit(ctx, stack, expr.getChild()); stack.pop(); LimitNode limitNode = ctx.getPlan().createNode(LimitNode.class); limitNode.setInSchema(child.getOutSchema()); limitNode.setOutSchema(child.getOutSchema()); return limitNode; }
@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; }
@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; }
public static ScanNode buildInputExecutor(LogicalPlan plan, DataChannel channel) { Preconditions.checkArgument(channel.getSchema() != null, "Channel schema (" + channel.getSrcId().getId() + " -> " + channel.getTargetId().getId() + ") is not initialized"); TableMeta meta = new TableMeta(channel.getDataFormat(), new KeyValueSet()); TableDesc desc = new TableDesc( channel.getSrcId().toString(), channel.getSchema(), meta, StorageConstants.LOCAL_FS_URI); ScanNode scanNode = plan.createNode(ScanNode.class); scanNode.init(desc); return scanNode; }