Search in sources :

Example 1 with JdbcClient

use of io.prestosql.plugin.jdbc.JdbcClient in project hetu-core by openlookeng.

the class TestJdbcPlanOptimizer method getOptimizedPlan.

private PlanNode getOptimizedPlan(PlanBuilder planBuilder, PlanNode originalPlan) {
    BaseJdbcConfig config = new BaseJdbcConfig();
    JdbcClient client = new TestPushwonClient();
    TesterParameter testerParameter = TesterParameter.getTesterParameter();
    JdbcPlanOptimizer optimizer = new JdbcPlanOptimizer(client, new TestTypeManager(), config, testerParameter.getRowExpressionService(), testerParameter.getDeterminismEvaluator(), testerParameter.getMetadata().getFunctionAndTypeManager(), testerParameter.getFunctionResolution());
    return optimizer.optimize(originalPlan, defaultSessionHolder.getConnectorSession(), ImmutableMap.<String, Type>builder().put("regionid", INTEGER).put("city", VARCHAR).put("fare", DOUBLE).put("amount", BIGINT).build(), new PlanSymbolAllocator(), planBuilder.getIdAllocator());
}
Also used : Type(io.prestosql.spi.type.Type) JdbcClient(io.prestosql.plugin.jdbc.JdbcClient) PlanSymbolAllocator(io.prestosql.sql.planner.PlanSymbolAllocator) BaseJdbcConfig(io.prestosql.plugin.jdbc.BaseJdbcConfig)

Aggregations

BaseJdbcConfig (io.prestosql.plugin.jdbc.BaseJdbcConfig)1 JdbcClient (io.prestosql.plugin.jdbc.JdbcClient)1 Type (io.prestosql.spi.type.Type)1 PlanSymbolAllocator (io.prestosql.sql.planner.PlanSymbolAllocator)1