use of io.mycat.calcite.ExecutorProvider in project Mycat2 by MyCATApache.
the class ObservablePlanImplementorImpl method executeQuery.
@Override
public Future<Void> executeQuery(Plan plan) {
AsyncMycatDataContextImpl.SqlMycatDataContextImpl sqlMycatDataContext = new AsyncMycatDataContextImpl.SqlMycatDataContextImpl(context, plan.getCodeExecuterContext(), drdsSqlWithParams);
ExecutorProvider executorProvider = MetaClusterCurrent.wrapper(ExecutorProvider.class);
PrepareExecutor prepare = executorProvider.prepare(plan);
if (context.isVector()) {
PrepareExecutor.ArrowObservable observable1 = prepare.asObservableVector(sqlMycatDataContext, plan.getMetaData());
return response.sendVectorResultSet(observable1.getMycatRowMetaData(), observable1.getObservable());
} else {
ArrayBindable arrayBindable = prepare.getArrayBindable();
Observable<MysqlPayloadObject> observable1 = PrepareExecutor.getMysqlPayloadObjectObservable(arrayBindable, sqlMycatDataContext, plan.getMetaData());
Observable observable = mapToTimeoutObservable(observable1, drdsSqlWithParams);
String parameterizedSQL = drdsSqlWithParams.getParameterizedSQL();
Future<Void> take = TimeRateLimiterService.STRING_INSTANCE.take(parameterizedSQL);
Observable<MysqlPayloadObject> executor = observable;
return response.sendResultSet(executor);
}
}
Aggregations