Skip to content

Commit

Permalink
Allow passing coordinator properties for Delta query runner
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed Mar 30, 2022
1 parent 9476347 commit dec5ca6
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ public static DistributedQueryRunner createDeltaLakeQueryRunner(Map<String, Stri
public static DistributedQueryRunner createS3DeltaLakeQueryRunner(String catalogName, String schemaName, Map<String, String> connectorProperties, String minioAddress, TestingHadoop testingHadoop)
throws Exception
{
return createS3DeltaLakeQueryRunner(catalogName, schemaName, ImmutableMap.of(), connectorProperties, minioAddress, testingHadoop, queryRunner -> {});
return createS3DeltaLakeQueryRunner(catalogName, schemaName, ImmutableMap.of(), ImmutableMap.of(), connectorProperties, minioAddress, testingHadoop, queryRunner -> {});
}

public static DistributedQueryRunner createS3DeltaLakeQueryRunner(
String catalogName,
String schemaName,
Map<String, String> extraProperties,
Map<String, String> coordinatorProperties,
Map<String, String> connectorProperties,
String minioAddress,
TestingHadoop testingHadoop,
Expand All @@ -104,6 +105,7 @@ public static DistributedQueryRunner createS3DeltaLakeQueryRunner(
return createDockerizedDeltaLakeQueryRunner(
catalogName,
schemaName,
coordinatorProperties,
extraProperties,
ImmutableMap.<String, String>builder()
.put("hive.s3.aws-access-key", MINIO_ACCESS_KEY)
Expand Down Expand Up @@ -166,6 +168,7 @@ public static DistributedQueryRunner createDockerizedDeltaLakeQueryRunner(
return createDockerizedDeltaLakeQueryRunner(
catalogName,
schemaName,
ImmutableMap.of(),
extraProperties,
connectorProperties,
testingHadoop,
Expand All @@ -175,6 +178,7 @@ public static DistributedQueryRunner createDockerizedDeltaLakeQueryRunner(
public static DistributedQueryRunner createDockerizedDeltaLakeQueryRunner(
String catalogName,
String schemaName,
Map<String, String> coordinatorProperties,
Map<String, String> extraProperties,
Map<String, String> connectorProperties,
TestingHadoop testingHadoop,
Expand All @@ -188,6 +192,7 @@ public static DistributedQueryRunner createDockerizedDeltaLakeQueryRunner(

DistributedQueryRunner.Builder<?> builder = DistributedQueryRunner.builder(session);
extraProperties.forEach(builder::addExtraProperty);
coordinatorProperties.forEach(builder::setSingleCoordinatorProperty);
builder.setAdditionalSetup(additionalSetup);
DistributedQueryRunner queryRunner = builder.build();

Expand Down Expand Up @@ -255,7 +260,7 @@ public static void main(String[] args)
queryRunner = DeltaLakeQueryRunner.createS3DeltaLakeQueryRunner(
DELTA_CATALOG,
schema,
ImmutableMap.of("http-server.http.port", "8080"),
ImmutableMap.of("http-server.http.port", "8080"), ImmutableMap.of(),
ImmutableMap.of(),
dockerizedMinioDataLake.getMinioAddress(),
dockerizedMinioDataLake.getTestingHadoop(),
Expand Down

0 comments on commit dec5ca6

Please sign in to comment.