diff --git a/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java b/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java index 94f72266d4cc2..c634d6414727a 100644 --- a/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java +++ b/presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java @@ -43,7 +43,9 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.OptionalInt; import java.util.UUID; @@ -121,7 +123,7 @@ public static QueryRunner createQueryRunner( defaultQueryRunner.close(); - return createNativeQueryRunner(dataDirectory.get().toString(), prestoServerPath.get(), workerCount, cacheMaxSize, true, Optional.empty(), storageFormat, addStorageFormatToPath, false, isCoordinatorSidecarEnabled); + return createNativeQueryRunner(dataDirectory.get().toString(), prestoServerPath.get(), workerCount, cacheMaxSize, true, Optional.empty(), storageFormat, addStorageFormatToPath, false, isCoordinatorSidecarEnabled, Collections.emptyMap(), Collections.emptyMap()); } public static QueryRunner createJavaQueryRunner() @@ -327,7 +329,9 @@ public static QueryRunner createNativeQueryRunner( String storageFormat, boolean addStorageFormatToPath, Boolean failOnNestedLoopJoin, - boolean isCoordinatorSidecarEnabled) + boolean isCoordinatorSidecarEnabled, + Map extraProperties, + Map extraCoordinatorProperties) throws Exception { // The property "hive.allow-drop-table" needs to be set to true because security is always "legacy" in NativeQueryRunner. @@ -345,8 +349,11 @@ public static QueryRunner createNativeQueryRunner( .put("experimental.internal-communication.thrift-transport-enabled", String.valueOf(useThrift)) .putAll(getNativeWorkerSystemProperties()) .putAll(isCoordinatorSidecarEnabled ? getNativeSidecarProperties() : ImmutableMap.of()) + .putAll(extraProperties) + .build(), + ImmutableMap.builder() + .putAll(extraCoordinatorProperties) .build(), - ImmutableMap.of(), "legacy", hiveProperties, workerCount, @@ -403,6 +410,28 @@ public static QueryRunner createNativeQueryRunner(String remoteFunctionServerUds return createNativeQueryRunner(false, DEFAULT_STORAGE_FORMAT, Optional.ofNullable(remoteFunctionServerUds), false, false); } + public static QueryRunner createNativeQueryRunner(Map extraProperties, Map extraCoordinatorProperties, + String storageFormat) + throws Exception + { + int cacheMaxSize = 0; + NativeQueryRunnerParameters nativeQueryRunnerParameters = getNativeQueryRunnerParameters(); + return createNativeQueryRunner( + nativeQueryRunnerParameters.dataDirectory.toString(), + nativeQueryRunnerParameters.serverBinary.toString(), + nativeQueryRunnerParameters.workerCount, + cacheMaxSize, + true, + Optional.empty(), + storageFormat, + true, + false, + false, + extraProperties, + extraCoordinatorProperties); + } + + public static QueryRunner createNativeQueryRunner(boolean useThrift) throws Exception { @@ -436,7 +465,9 @@ public static QueryRunner createNativeQueryRunner(boolean useThrift, String stor storageFormat, true, failOnNestedLoopJoin, - isCoordinatorSidecarEnabled); + isCoordinatorSidecarEnabled, + Collections.emptyMap(), + Collections.emptyMap()); } // Start the remote function server. Return the UDS path used to communicate with it. diff --git a/presto-native-tests/pom.xml b/presto-native-tests/pom.xml index c38fd6ecfb793..4f8ec8035d761 100644 --- a/presto-native-tests/pom.xml +++ b/presto-native-tests/pom.xml @@ -5,7 +5,7 @@ com.facebook.presto presto-root - 0.290-SNAPSHOT + 0.291-SNAPSHOT presto-native-tests