use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestHivePlugin method testThriftMetastore.
@Test
public void testThriftMetastore() {
ConnectorFactory factory = getHiveConnectorFactory();
factory.create("test", ImmutableMap.of("hive.metastore", "thrift", "hive.metastore.uri", "thrift://foo:1234"), new TestingConnectorContext()).shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestHivePlugin method testRecordingMetastore.
@Test
public void testRecordingMetastore() {
ConnectorFactory factory = getHiveConnectorFactory();
factory.create("test", ImmutableMap.of("hive.metastore", "thrift", "hive.metastore.uri", "thrift://foo:1234", "hive.metastore-recording-path", "/tmp"), new TestingConnectorContext()).shutdown();
factory.create("test", ImmutableMap.of("hive.metastore", "glue", "hive.metastore.glue.region", "us-east-2", "hive.metastore-recording-path", "/tmp"), new TestingConnectorContext()).shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestHivePlugin method testInsertOverwriteIsSetToErrorWhenImmutablePartitionsIsTrue.
@Test
public void testInsertOverwriteIsSetToErrorWhenImmutablePartitionsIsTrue() {
ConnectorFactory connectorFactory = getHiveConnectorFactory();
Connector connector = connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.immutable-partitions", "true").put("hive.metastore.uri", "thrift://foo:1234").buildOrThrow(), new TestingConnectorContext());
assertThat(getDefaultValueInsertExistingPartitionsBehavior(connector)).isEqualTo(ERROR);
connector.shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestHivePlugin method testInsertOverwriteIsSetToAppendWhenImmutablePartitionsIsFalseByDefault.
@Test
public void testInsertOverwriteIsSetToAppendWhenImmutablePartitionsIsFalseByDefault() {
ConnectorFactory connectorFactory = getHiveConnectorFactory();
Connector connector = connectorFactory.create("test", ImmutableMap.<String, String>builder().put("hive.metastore.uri", "thrift://foo:1234").buildOrThrow(), new TestingConnectorContext());
assertThat(getDefaultValueInsertExistingPartitionsBehavior(connector)).isEqualTo(APPEND);
connector.shutdown();
}
use of io.trino.testing.TestingConnectorContext 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");
}
Aggregations