use of io.mycat.calcite.physical.MycatUpdateRel in project Mycat2 by MyCATApache.
the class DrdsSqlCompiler method complieNormalUpdate.
@NotNull
private MycatRel complieNormalUpdate(OptimizationContext optimizationContext, DrdsSql drdsSql, SQLStatement sqlStatement, NormalTable logicTable) {
MycatUpdateRel mycatUpdateRel = new MycatUpdateRel(sqlStatement);
optimizationContext.saveAlways();
return mycatUpdateRel;
}
use of io.mycat.calcite.physical.MycatUpdateRel in project Mycat2 by MyCATApache.
the class ObservablePlanImplementorImpl method executeUpdate.
@Override
public Future<Void> executeUpdate(Plan plan) {
MycatUpdateRel mycatRel = (MycatUpdateRel) plan.getMycatRel();
Collection<VertxExecuter.EachSQL> eachSQLS = VertxUpdateExecuter.explainUpdate(drdsSqlWithParams, context);
Future<long[]> future = VertxExecuter.simpleUpdate(context, mycatRel.isInsert(), true, mycatRel.isGlobal(), eachSQLS);
return future.eventually(u -> context.getTransactionSession().closeStatementState()).flatMap(result -> response.sendOk(result[0], result[1]));
}
use of io.mycat.calcite.physical.MycatUpdateRel in project Mycat2 by MyCATApache.
the class DrdsSqlCompiler method compileUpdate.
private MycatRel compileUpdate(TableHandler logicTable, OptimizationContext optimizationContext, DrdsSql drdsSql, SchemaPlus plus) {
MycatUpdateRel mycatUpdateRel = new MycatUpdateRel(drdsSql.getParameterizedStatement());
optimizationContext.saveAlways();
return mycatUpdateRel;
}
use of io.mycat.calcite.physical.MycatUpdateRel in project Mycat2 by MyCATApache.
the class DrdsSqlCompiler method compileDelete.
private MycatRel compileDelete(TableHandler logicTable, OptimizationContext optimizationContext, DrdsSql drdsSql, SchemaPlus plus) {
MycatUpdateRel mycatUpdateRel = new MycatUpdateRel(drdsSql.getParameterizedStatement());
optimizationContext.saveAlways();
return mycatUpdateRel;
}
use of io.mycat.calcite.physical.MycatUpdateRel in project Mycat2 by MyCATApache.
the class DrdsSqlCompiler method complieGlobalUpdate.
@NotNull
private MycatRel complieGlobalUpdate(OptimizationContext optimizationContext, DrdsSql drdsSql, SQLStatement sqlStatement, GlobalTable logicTable) {
MycatUpdateRel mycatUpdateRel = new MycatUpdateRel(sqlStatement, true);
optimizationContext.saveAlways();
return mycatUpdateRel;
}
Aggregations