Skip to content

Commit

Permalink
cccc
Browse files Browse the repository at this point in the history
  • Loading branch information
athmaja-n committed Nov 18, 2024
1 parent f464733 commit ee08777
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -327,7 +329,9 @@ public static QueryRunner createNativeQueryRunner(
String storageFormat,
boolean addStorageFormatToPath,
Boolean failOnNestedLoopJoin,
boolean isCoordinatorSidecarEnabled)
boolean isCoordinatorSidecarEnabled,
Map<String, String> extraProperties,
Map<String, String> extraCoordinatorProperties)
throws Exception
{
// The property "hive.allow-drop-table" needs to be set to true because security is always "legacy" in NativeQueryRunner.
Expand All @@ -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.<String, String>builder()
.putAll(extraCoordinatorProperties)
.build(),
ImmutableMap.of(),
"legacy",
hiveProperties,
workerCount,
Expand Down Expand Up @@ -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<String, String> extraProperties, Map<String, String> 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
{
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion presto-native-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.facebook.presto</groupId>
<artifactId>presto-root</artifactId>
<version>0.290-SNAPSHOT</version>
<version>0.291-SNAPSHOT</version>
</parent>

<artifactId>presto-native-tests</artifactId>
Expand Down

0 comments on commit ee08777

Please sign in to comment.