Search in sources :

Example 1 with TestingConnectorContext

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();
}
Also used : ConnectorFactory(io.trino.spi.connector.ConnectorFactory) TestingConnectorContext(io.trino.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Example 2 with TestingConnectorContext

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();
}
Also used : ConnectorFactory(io.trino.spi.connector.ConnectorFactory) TestingConnectorContext(io.trino.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Example 3 with TestingConnectorContext

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();
}
Also used : Connector(io.trino.spi.connector.Connector) ConnectorFactory(io.trino.spi.connector.ConnectorFactory) TestingConnectorContext(io.trino.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Example 4 with TestingConnectorContext

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();
}
Also used : Connector(io.trino.spi.connector.Connector) ConnectorFactory(io.trino.spi.connector.ConnectorFactory) TestingConnectorContext(io.trino.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Example 5 with TestingConnectorContext

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");
}
Also used : ConnectorFactory(io.trino.spi.connector.ConnectorFactory) TestingConnectorContext(io.trino.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Aggregations

TestingConnectorContext (io.trino.testing.TestingConnectorContext)64 ConnectorFactory (io.trino.spi.connector.ConnectorFactory)56 Test (org.testng.annotations.Test)53 Plugin (io.trino.spi.Plugin)22 Connector (io.trino.spi.connector.Connector)14 HdfsEnvironment (io.trino.plugin.hive.HdfsEnvironment)5 TypeManager (io.trino.spi.type.TypeManager)5 File (java.io.File)4 Path (java.nio.file.Path)4 BeforeClass (org.testng.annotations.BeforeClass)4 TransactionLogAccess (io.trino.plugin.deltalake.transactionlog.TransactionLogAccess)3 CheckpointSchemaManager (io.trino.plugin.deltalake.transactionlog.checkpoint.CheckpointSchemaManager)3 FileFormatDataSourceStats (io.trino.plugin.hive.FileFormatDataSourceStats)3 HdfsConfig (io.trino.plugin.hive.HdfsConfig)3 HdfsConfiguration (io.trino.plugin.hive.HdfsConfiguration)3 HdfsConfigurationInitializer (io.trino.plugin.hive.HdfsConfigurationInitializer)3 HiveHdfsConfiguration (io.trino.plugin.hive.HiveHdfsConfiguration)3 NodeVersion (io.trino.plugin.hive.NodeVersion)3 NoHdfsAuthentication (io.trino.plugin.hive.authentication.NoHdfsAuthentication)3 ParquetReaderConfig (io.trino.plugin.hive.parquet.ParquetReaderConfig)3