use of io.trino.spi.Plugin in project trino by trinodb.
the class TestDeltaLakePlugin method testThriftMetastore.
@Test
public void testThriftMetastore() {
Plugin plugin = new TestingDeltaLakePlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("hive.metastore", "thrift", "hive.metastore.uri", "thrift://foo:1234"), new TestingConnectorContext()).shutdown();
assertThatThrownBy(() -> factory.create("test", ImmutableMap.of("hive.metastore", "thrift", "hive.metastore.uri", "thrift://foo:1234", "delta.hide-non-delta-lake-tables", "true"), new TestingConnectorContext())).isInstanceOf(ApplicationConfigurationException.class).hasMessageContaining("Error: Configuration property 'delta.hide-non-delta-lake-tables' was not used");
}
use of io.trino.spi.Plugin in project trino by trinodb.
the class TestDeltaLakePlugin method testGlueMetastore.
@Test
public void testGlueMetastore() {
Plugin plugin = new TestingDeltaLakePlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("hive.metastore", "glue", "hive.metastore.glue.region", "us-east-2"), new TestingConnectorContext());
assertThatThrownBy(() -> factory.create("test", ImmutableMap.of("hive.metastore", "glue", "hive.metastore.uri", "thrift://foo:1234"), new TestingConnectorContext())).isInstanceOf(ApplicationConfigurationException.class).hasMessageContaining("Error: Configuration property 'hive.metastore.uri' was not used");
}
use of io.trino.spi.Plugin in project trino by trinodb.
the class RuleTester method defaultRuleTester.
public static RuleTester defaultRuleTester(List<Plugin> plugins, Map<String, String> sessionProperties, Optional<Integer> nodeCountForStats) {
Session.SessionBuilder sessionBuilder = testSessionBuilder().setCatalog(CATALOG_ID).setSchema("tiny").setSystemProperty("task_concurrency", // these tests don't handle exchanges from local parallel
"1");
for (Map.Entry<String, String> entry : sessionProperties.entrySet()) {
sessionBuilder.setSystemProperty(entry.getKey(), entry.getValue());
}
Session session = sessionBuilder.build();
LocalQueryRunner queryRunner = nodeCountForStats.map(nodeCount -> LocalQueryRunner.builder(session).withNodeCountForStats(nodeCount).build()).orElseGet(() -> LocalQueryRunner.create(session));
queryRunner.createCatalog(session.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
plugins.forEach(queryRunner::installPlugin);
return new RuleTester(queryRunner);
}
use of io.trino.spi.Plugin in project trino by trinodb.
the class TestClickHousePlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new ClickHousePlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("connection-url", "jdbc:clickhouse://test"), new TestingConnectorContext());
}
use of io.trino.spi.Plugin in project trino by trinodb.
the class TestDruidJdbcPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new DruidJdbcPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("connection-url", "jdbc:druid:test"), new TestingConnectorContext()).shutdown();
}
Aggregations