use of io.trino.plugin.jdbc.JdbcPlugin in project trino by trinodb.
the class BaseQueryAssertionsTest method configureCatalog.
protected void configureCatalog(QueryRunner queryRunner) {
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch", ImmutableMap.of());
queryRunner.installPlugin(new JdbcPlugin("base-jdbc", new TestingH2JdbcModule()));
Map<String, String> jdbcConfigurationProperties = TestingH2JdbcModule.createProperties();
queryRunner.createCatalog("jdbc", "base-jdbc", jdbcConfigurationProperties);
try (Connection connection = DriverManager.getConnection(jdbcConfigurationProperties.get("connection-url"));
Statement statement = connection.createStatement()) {
statement.execute("CREATE SCHEMA " + "tpch");
} catch (SQLException e) {
throw new RuntimeException(e);
}
copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, queryRunner.getDefaultSession(), List.of(NATION));
Map<String, String> jdbcWithAggregationPushdownDisabledConfigurationProperties = ImmutableMap.<String, String>builder().putAll(jdbcConfigurationProperties).put("aggregation-pushdown.enabled", "false").buildOrThrow();
queryRunner.createCatalog("jdbc_with_aggregation_pushdown_disabled", "base-jdbc", jdbcWithAggregationPushdownDisabledConfigurationProperties);
}
Aggregations