Search in sources :

Example 1 with SysUpdateProjection

use of io.crate.planner.projection.SysUpdateProjection in project crate by crate.

the class UpdateConsumer method createSysTableUpdatePlan.

private static Plan createSysTableUpdatePlan(TableInfo tableInfo, Planner.Context plannerContext, UpdateAnalyzedStatement.NestedAnalyzedStatement nestedStatement) {
    Routing routing = plannerContext.allocateRouting(tableInfo, nestedStatement.whereClause(), Preference.PRIMARY.type());
    Reference idReference = tableInfo.getReference(DocSysColumns.ID);
    assert idReference != null : "table has no _id column";
    SysUpdateProjection updateProjection = new SysUpdateProjection(idReference.valueType(), nestedStatement.assignments());
    return createPlan(plannerContext, routing, tableInfo, idReference, updateProjection, nestedStatement.whereClause());
}
Also used : SysUpdateProjection(io.crate.planner.projection.SysUpdateProjection) Reference(io.crate.metadata.Reference) Routing(io.crate.metadata.Routing)

Aggregations

Reference (io.crate.metadata.Reference)1 Routing (io.crate.metadata.Routing)1 SysUpdateProjection (io.crate.planner.projection.SysUpdateProjection)1