Search in sources :

Example 1 with ShardedTable

use of io.crate.metadata.table.ShardedTable in project crate by crate.

the class AlterTableRerouteAnalyzer method analyze.

public AnalyzedStatement analyze(AlterTableReroute<Expression> alterTableReroute, ParamTypeHints paramTypeHints, CoordinatorTxnCtx transactionContext) {
    // safe to expect a `ShardedTable` since getTableInfo with
    // Operation.ALTER_REROUTE raises a appropriate error for sys tables
    ShardedTable tableInfo;
    RelationName relationName;
    if (alterTableReroute.blob()) {
        relationName = fromBlobTable(alterTableReroute.table());
    } else {
        relationName = schemas.resolveRelation(alterTableReroute.table().getName(), transactionContext.sessionContext().searchPath());
    }
    tableInfo = schemas.getTableInfo(relationName, Operation.ALTER_REROUTE);
    return alterTableReroute.rerouteOption().accept(rerouteOptionVisitor, new Context(tableInfo, alterTableReroute.table().partitionProperties(), transactionContext, nodeCtx, paramTypeHints));
}
Also used : NodeContext(io.crate.metadata.NodeContext) ExpressionAnalysisContext(io.crate.analyze.expressions.ExpressionAnalysisContext) RelationName(io.crate.metadata.RelationName) ShardedTable(io.crate.metadata.table.ShardedTable)

Aggregations

ExpressionAnalysisContext (io.crate.analyze.expressions.ExpressionAnalysisContext)1 NodeContext (io.crate.metadata.NodeContext)1 RelationName (io.crate.metadata.RelationName)1 ShardedTable (io.crate.metadata.table.ShardedTable)1