Skip to content

Commit

Permalink
Use native S3 for connector tests
Browse files Browse the repository at this point in the history
  • Loading branch information
electrum committed Jan 25, 2024
1 parent 770ca2b commit 5655a28
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ public class TestDeltaLakeMinioAndHmsConnectorSmokeTest
protected Map<String, String> hiveStorageConfiguration()
{
return ImmutableMap.<String, String>builder()
.put("hive.s3.aws-access-key", MINIO_ACCESS_KEY)
.put("hive.s3.aws-secret-key", MINIO_SECRET_KEY)
.put("hive.s3.endpoint", hiveMinioDataLake.getMinio().getMinioAddress())
.put("hive.s3.path-style-access", "true")
.put("hive.s3.max-connections", "2")
.put("fs.hadoop.enabled", "false")
.put("fs.native-s3.enabled", "true")
.put("s3.aws-access-key", MINIO_ACCESS_KEY)
.put("s3.aws-secret-key", MINIO_SECRET_KEY)
.put("s3.region", MINIO_REGION)
.put("s3.endpoint", hiveMinioDataLake.getMinio().getMinioAddress())
.put("s3.path-style-access", "true")
.put("s3.max-connections", "2")
.buildOrThrow();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import static io.trino.plugin.iceberg.catalog.rest.RestCatalogTestUtils.backendCatalog;
import static io.trino.testing.TestingSession.testSessionBuilder;
import static io.trino.testing.containers.Minio.MINIO_ACCESS_KEY;
import static io.trino.testing.containers.Minio.MINIO_REGION;
import static io.trino.testing.containers.Minio.MINIO_SECRET_KEY;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Objects.requireNonNull;
Expand Down Expand Up @@ -226,11 +227,14 @@ public static void main(String[] args)
.setIcebergProperties(Map.of(
"iceberg.catalog.type", "HIVE_METASTORE",
"hive.metastore.uri", "thrift://" + hiveMinioDataLake.getHiveHadoop().getHiveMetastoreEndpoint(),
"hive.s3.aws-access-key", MINIO_ACCESS_KEY,
"hive.s3.aws-secret-key", MINIO_SECRET_KEY,
"hive.s3.endpoint", hiveMinioDataLake.getMinio().getMinioAddress(),
"hive.s3.path-style-access", "true",
"hive.s3.streaming.part-size", "5MB"))
"fs.hadoop.enabled", "false",
"fs.native-s3.enabled", "true",
"s3.aws-access-key", MINIO_ACCESS_KEY,
"s3.aws-secret-key", MINIO_SECRET_KEY,
"s3.region", MINIO_REGION,
"s3.endpoint", hiveMinioDataLake.getMinio().getMinioAddress(),
"s3.path-style-access", "true",
"s3.streaming.part-size", "5MB"))
.setSchemaInitializer(
SchemaInitializer.builder()
.withSchemaName("tpch")
Expand Down Expand Up @@ -267,11 +271,14 @@ public static void main(String[] args)
.setIcebergProperties(Map.of(
"iceberg.catalog.type", "TESTING_FILE_METASTORE",
"hive.metastore.catalog.dir", "s3://%s/".formatted(bucketName),
"hive.s3.aws-access-key", MINIO_ACCESS_KEY,
"hive.s3.aws-secret-key", MINIO_SECRET_KEY,
"hive.s3.endpoint", "http://" + minio.getMinioApiEndpoint(),
"hive.s3.path-style-access", "true",
"hive.s3.streaming.part-size", "5MB"))
"fs.hadoop.enabled", "false",
"fs.native-s3.enabled", "true",
"s3.aws-access-key", MINIO_ACCESS_KEY,
"s3.aws-secret-key", MINIO_SECRET_KEY,
"s3.region", MINIO_REGION,
"s3.endpoint", "http://" + minio.getMinioApiEndpoint(),
"s3.path-style-access", "true",
"s3.streaming.part-size", "5MB"))
.setSchemaInitializer(
SchemaInitializer.builder()
.withSchemaName("tpch")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import static io.trino.plugin.iceberg.IcebergQueryRunner.ICEBERG_CATALOG;
import static io.trino.testing.TestingNames.randomNameSuffix;
import static io.trino.testing.containers.Minio.MINIO_ACCESS_KEY;
import static io.trino.testing.containers.Minio.MINIO_REGION;
import static io.trino.testing.containers.Minio.MINIO_SECRET_KEY;
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -50,10 +51,13 @@ protected QueryRunner createQueryRunner()
QueryRunner queryRunner = IcebergQueryRunner.builder()
.setIcebergProperties(
ImmutableMap.<String, String>builder()
.put("hive.s3.aws-access-key", MINIO_ACCESS_KEY)
.put("hive.s3.aws-secret-key", MINIO_SECRET_KEY)
.put("hive.s3.endpoint", minio.getMinioAddress())
.put("hive.s3.path-style-access", "true")
.put("fs.hadoop.enabled", "false")
.put("fs.native-s3.enabled", "true")
.put("s3.aws-access-key", MINIO_ACCESS_KEY)
.put("s3.aws-secret-key", MINIO_SECRET_KEY)
.put("s3.region", MINIO_REGION)
.put("s3.endpoint", minio.getMinioAddress())
.put("s3.path-style-access", "true")
.put("iceberg.register-table-procedure.enabled", "true")
.buildOrThrow())
.build();
Expand Down

0 comments on commit 5655a28

Please sign in to comment.