use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class TestBeginQuery method setUp.
@BeforeClass
public void setUp() {
metadata = new TestMetadata();
getQueryRunner().installPlugin(new TestPlugin(metadata));
getQueryRunner().installPlugin(new TpchPlugin());
getQueryRunner().createCatalog("test", "test", ImmutableMap.of());
getQueryRunner().createCatalog("tpch", "tpch", ImmutableMap.of());
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class H2TestUtil method createQueryRunner.
public static DistributedQueryRunner createQueryRunner(String dbConfigUrl, H2ResourceGroupsDao dao, String environment) throws Exception {
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(testSessionBuilder().setCatalog("tpch").setSchema("tiny").build()).setNodeCount(2).setEnvironment(environment).build();
try {
Plugin h2ResourceGroupManagerPlugin = new H2ResourceGroupManagerPlugin();
queryRunner.installPlugin(h2ResourceGroupManagerPlugin);
queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager(CONFIGURATION_MANAGER_TYPE, ImmutableMap.of("resource-groups.config-db-url", dbConfigUrl, "node.environment", environment));
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
setup(queryRunner, dao, environment);
return queryRunner;
} catch (Exception e) {
queryRunner.close();
throw e;
}
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class TestUserImpersonationAccessControl method createQueryRunner.
@Override
protected QueryRunner createQueryRunner() throws Exception {
String securityConfigFile = getResource("access_control_rules.json").getPath();
SystemAccessControl accessControl = new FileBasedSystemAccessControl.Factory().create(ImmutableMap.of(SECURITY_CONFIG_FILE, securityConfigFile));
QueryRunner queryRunner = DistributedQueryRunner.builder(TEST_SESSION).setNodeCount(1).setSystemAccessControl(accessControl).build();
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch", ImmutableMap.of());
return queryRunner;
}
use of io.trino.plugin.tpch.TpchPlugin 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);
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class BlackHoleQueryRunner method createQueryRunner.
public static DistributedQueryRunner createQueryRunner(Map<String, String> extraProperties) throws Exception {
Session session = testSessionBuilder().setCatalog("blackhole").setSchema("default").build();
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(session).setNodeCount(4).setExtraProperties(extraProperties).build();
try {
queryRunner.installPlugin(new BlackHolePlugin());
queryRunner.createCatalog("blackhole", "blackhole", ImmutableMap.of());
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch", ImmutableMap.of());
return queryRunner;
} catch (Exception e) {
closeAllSuppress(e, queryRunner);
throw e;
}
}
Aggregations