Search in sources :

Example 31 with TestingConnectorContext

use of io.trino.testing.TestingConnectorContext in project trino by trinodb.

the class TestIcebergPlugin method testThriftMetastore.

@Test
public void testThriftMetastore() {
    ConnectorFactory factory = getConnectorFactory();
    factory.create("test", Map.of("iceberg.catalog.type", "HIVE_METASTORE", "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 32 with TestingConnectorContext

use of io.trino.testing.TestingConnectorContext in project trino by trinodb.

the class TestIcebergPlugin method testHiveMetastoreRejected.

@Test
public void testHiveMetastoreRejected() {
    ConnectorFactory factory = getConnectorFactory();
    assertThatThrownBy(() -> factory.create("test", Map.of("hive.metastore", "thrift", "hive.metastore.uri", "thrift://foo:1234"), new TestingConnectorContext())).hasMessageContaining("Error: Configuration property 'hive.metastore' was not used");
}
Also used : ConnectorFactory(io.trino.spi.connector.ConnectorFactory) TestingConnectorContext(io.trino.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Example 33 with TestingConnectorContext

use of io.trino.testing.TestingConnectorContext in project trino by trinodb.

the class TestIcebergPlugin method testRecordingMetastore.

@Test
public void testRecordingMetastore() {
    ConnectorFactory factory = getConnectorFactory();
    // recording with thrift
    factory.create("test", Map.of("iceberg.catalog.type", "HIVE_METASTORE", "hive.metastore.uri", "thrift://foo:1234", "hive.metastore-recording-path", "/tmp"), new TestingConnectorContext()).shutdown();
    // recording with glue
    assertThatThrownBy(() -> factory.create("test", Map.of("iceberg.catalog.type", "glue", "hive.metastore.glue.region", "us-east-2", "hive.metastore-recording-path", "/tmp"), new TestingConnectorContext())).hasMessageContaining("Configuration property 'hive.metastore-recording-path' was not used");
}
Also used : ConnectorFactory(io.trino.spi.connector.ConnectorFactory) TestingConnectorContext(io.trino.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Example 34 with TestingConnectorContext

use of io.trino.testing.TestingConnectorContext in project trino by trinodb.

the class TestIcebergPlugin method testAllowAllAccessControl.

@Test
public void testAllowAllAccessControl() {
    ConnectorFactory connectorFactory = getConnectorFactory();
    connectorFactory.create("test", ImmutableMap.<String, String>builder().put("iceberg.catalog.type", "HIVE_METASTORE").put("hive.metastore.uri", "thrift://foo:1234").put("iceberg.security", "allow-all").buildOrThrow(), new TestingConnectorContext()).shutdown();
}
Also used : ConnectorFactory(io.trino.spi.connector.ConnectorFactory) TestingConnectorContext(io.trino.testing.TestingConnectorContext) Test(org.testng.annotations.Test)

Example 35 with TestingConnectorContext

use of io.trino.testing.TestingConnectorContext in project trino by trinodb.

the class TestIcebergPlugin method testFileBasedAccessControl.

@Test
public void testFileBasedAccessControl() throws Exception {
    ConnectorFactory connectorFactory = getConnectorFactory();
    File tempFile = File.createTempFile("test-iceberg-plugin-access-control", ".json");
    tempFile.deleteOnExit();
    Files.write(tempFile.toPath(), "{}".getBytes(UTF_8));
    connectorFactory.create("test", ImmutableMap.<String, String>builder().put("iceberg.catalog.type", "HIVE_METASTORE").put("hive.metastore.uri", "thrift://foo:1234").put("iceberg.security", "file").put("security.config-file", tempFile.getAbsolutePath()).buildOrThrow(), new TestingConnectorContext()).shutdown();
}
Also used : ConnectorFactory(io.trino.spi.connector.ConnectorFactory) TestingConnectorContext(io.trino.testing.TestingConnectorContext) File(java.io.File) 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