Search in sources :

Example 11 with DrdsSqlWithParams

use of io.mycat.DrdsSqlWithParams in project Mycat2 by MyCATApache.

the class ShardingJoinTest method parse.

public static Explain parse(String sql) {
    DrdsSqlCompiler drds = getDrds();
    DrdsSqlWithParams drdsSqlWithParams = DrdsRunnerHelper.preParse(sql, null);
    OptimizationContext optimizationContext = new OptimizationContext();
    MycatRel dispatch = drds.dispatch(optimizationContext, drdsSqlWithParams);
    Plan plan = new PlanImpl(dispatch, DrdsExecutorCompiler.getCodeExecuterContext(optimizationContext.relNodeContext.getConstantMap(), dispatch, false), drdsSqlWithParams.getAliasList());
    return new Explain(plan, drdsSqlWithParams);
}
Also used : DrdsSqlCompiler(io.mycat.DrdsSqlCompiler) MycatRel(io.mycat.calcite.MycatRel) OptimizationContext(io.mycat.calcite.rewriter.OptimizationContext) Plan(io.mycat.calcite.spm.Plan) DrdsSqlWithParams(io.mycat.DrdsSqlWithParams) PlanImpl(io.mycat.calcite.spm.PlanImpl)

Example 12 with DrdsSqlWithParams

use of io.mycat.DrdsSqlWithParams in project Mycat2 by MyCATApache.

the class UnionAllTest method parse.

public static Explain parse(String sql) {
    DrdsSqlCompiler drds = getDrds();
    DrdsSqlWithParams drdsSqlWithParams = DrdsRunnerHelper.preParse(sql, null);
    OptimizationContext optimizationContext = new OptimizationContext();
    MycatRel dispatch = drds.dispatch(optimizationContext, drdsSqlWithParams);
    Plan plan = new PlanImpl(dispatch, DrdsExecutorCompiler.getCodeExecuterContext(optimizationContext.relNodeContext.getConstantMap(), dispatch, false), drdsSqlWithParams.getAliasList());
    return new Explain(plan, drdsSqlWithParams);
}
Also used : DrdsSqlCompiler(io.mycat.DrdsSqlCompiler) MycatRel(io.mycat.calcite.MycatRel) OptimizationContext(io.mycat.calcite.rewriter.OptimizationContext) Plan(io.mycat.calcite.spm.Plan) DrdsSqlWithParams(io.mycat.DrdsSqlWithParams) PlanImpl(io.mycat.calcite.spm.PlanImpl)

Example 13 with DrdsSqlWithParams

use of io.mycat.DrdsSqlWithParams in project Mycat2 by MyCATApache.

the class AllShardingJoinTest method parse.

public static Explain parse(String sql) {
    DrdsSqlCompiler drds = getDrds();
    DrdsSqlWithParams drdsSqlWithParams = DrdsRunnerHelper.preParse(sql, null);
    OptimizationContext optimizationContext = new OptimizationContext();
    MycatRel dispatch = drds.dispatch(optimizationContext, drdsSqlWithParams);
    Plan plan = new PlanImpl(dispatch, DrdsExecutorCompiler.getCodeExecuterContext(optimizationContext.relNodeContext.getConstantMap(), dispatch, false), drdsSqlWithParams.getAliasList());
    return new Explain(plan, drdsSqlWithParams);
}
Also used : DrdsSqlCompiler(io.mycat.DrdsSqlCompiler) MycatRel(io.mycat.calcite.MycatRel) OptimizationContext(io.mycat.calcite.rewriter.OptimizationContext) Plan(io.mycat.calcite.spm.Plan) DrdsSqlWithParams(io.mycat.DrdsSqlWithParams) PlanImpl(io.mycat.calcite.spm.PlanImpl)

Aggregations

DrdsSqlWithParams (io.mycat.DrdsSqlWithParams)13 Plan (io.mycat.calcite.spm.Plan)7 AsyncMycatDataContextImpl (io.mycat.AsyncMycatDataContextImpl)5 MycatRel (io.mycat.calcite.MycatRel)5 DrdsSqlCompiler (io.mycat.DrdsSqlCompiler)4 OptimizationContext (io.mycat.calcite.rewriter.OptimizationContext)4 PlanImpl (io.mycat.calcite.spm.PlanImpl)4 ImmutableMultimap (com.google.common.collect.ImmutableMultimap)3 MycatView (io.mycat.calcite.logical.MycatView)3 CalciteRowMetaData (io.mycat.calcite.resultset.CalciteRowMetaData)3 VertxExecuter (io.mycat.vertx.VertxExecuter)3 MycatDataContext (io.mycat.MycatDataContext)2 RowBaseIterator (io.mycat.api.collector.RowBaseIterator)2 CopyMycatRowMetaData (io.mycat.beans.mycat.CopyMycatRowMetaData)2 MycatRowMetaData (io.mycat.beans.mycat.MycatRowMetaData)2 ResultSetBuilder (io.mycat.beans.mycat.ResultSetBuilder)2 io.mycat.calcite (io.mycat.calcite)2 NewMycatConnection (io.mycat.newquery.NewMycatConnection)2 HackRouter (io.mycat.prototypeserver.mysql.HackRouter)2 CalciteCompiler (io.ordinate.engine.builder.CalciteCompiler)2