use of io.trino.spi.connector.ConnectorFactory in project trino by trinodb.
the class TestHivePlugin method testHdfsImpersonationAndHiveCachingMutuallyExclusive.
@Test
public void testHdfsImpersonationAndHiveCachingMutuallyExclusive() {
ConnectorFactory connectorFactory = getHiveConnectorFactory();
assertThatThrownBy(() -> connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.hdfs.impersonation.enabled", "true").put("hive.cache.enabled", "true").put("hive.metastore.uri", "thrift://foo:1234").put("hive.cache.location", tempDirectory.toString()).buildOrThrow(), new TestingConnectorContext())).hasMessageContaining("HDFS impersonation is not compatible with Hive caching");
}
use of io.trino.spi.connector.ConnectorFactory in project trino by trinodb.
the class TestHivePlugin method testReadOnlyAllAccessControl.
@Test
public void testReadOnlyAllAccessControl() {
ConnectorFactory connectorFactory = getHiveConnectorFactory();
connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.metastore.uri", "thrift://foo:1234").put("hive.security", "read-only").buildOrThrow(), new TestingConnectorContext()).shutdown();
}
use of io.trino.spi.connector.ConnectorFactory in project trino by trinodb.
the class TestHivePlugin method testAllowAllAccessControl.
@Test
public void testAllowAllAccessControl() {
ConnectorFactory connectorFactory = getHiveConnectorFactory();
connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.metastore.uri", "thrift://foo:1234").put("hive.security", "allow-all").buildOrThrow(), new TestingConnectorContext()).shutdown();
}
use of io.trino.spi.connector.ConnectorFactory in project trino by trinodb.
the class TestHivePlugin method testRubixCacheWithNonExistingCacheDirectory.
@Test
public void testRubixCacheWithNonExistingCacheDirectory() {
ConnectorFactory connectorFactory = getHiveConnectorFactory();
assertThatThrownBy(() -> connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.cache.enabled", "true").put("hive.cache.start-server-on-coordinator", "true").put("hive.metastore.uri", "thrift://foo:1234").put("hive.cache.location", "/tmp/non/existing/directory").buildOrThrow(), new TestingConnectorContext())).hasRootCauseMessage("None of the cache parent directories exists");
assertThatThrownBy(() -> connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.cache.enabled", "true").put("hive.cache.start-server-on-coordinator", "true").put("hive.metastore.uri", "thrift://foo:1234").buildOrThrow(), new TestingConnectorContext())).hasRootCauseMessage("caching directories were not provided");
// cache directories should not be required when cache is not explicitly started on coordinator
connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.cache.enabled", "true").put("hive.metastore.uri", "thrift://foo:1234").buildOrThrow(), new TestingConnectorContext()).shutdown();
}
use of io.trino.spi.connector.ConnectorFactory 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");
}
Aggregations