Skip to content

Commit a12b523

Browse files
committed
[native] Use builder pattern for native queryRunner
1 parent f0fffd3 commit a12b523

File tree

46 files changed

+586
-466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+586
-466
lines changed

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/HiveExternalWorkerQueryRunner.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ public static void main(String[] args)
2929
Logging.initialize();
3030

3131
// Create tables before launching distributed runner.
32-
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.createJavaQueryRunner(false);
32+
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder().build();
3333
NativeQueryRunnerUtils.createAllTables(javaQueryRunner);
3434
javaQueryRunner.close();
3535

3636
// Launch distributed runner.
37-
DistributedQueryRunner queryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.createQueryRunner(false, false, false, false);
37+
DistributedQueryRunner queryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder().build();
3838
Thread.sleep(10);
3939
Logger log = Logger.get(DistributedQueryRunner.class);
4040
log.info("======== SERVER STARTED ========");

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/IcebergExternalWorkerQueryRunner.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ public static void main(String[] args)
2929
Logging.initialize();
3030

3131
// Create tables before launching distributed runner.
32-
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.createJavaIcebergQueryRunner(false);
32+
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.javaIcebergQueryRunnerBuilder().build();
3333
NativeQueryRunnerUtils.createAllIcebergTables(javaQueryRunner);
3434
javaQueryRunner.close();
3535

3636
// Launch distributed runner.
37-
DistributedQueryRunner queryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.createNativeIcebergQueryRunner(true, false);
37+
DistributedQueryRunner queryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.nativeIcebergQueryRunnerBuilder()
38+
.setUseThrift(true)
39+
.build();
3840
Thread.sleep(10);
3941
Logger log = Logger.get(DistributedQueryRunner.class);
4042
log.info("======== SERVER STARTED ========");

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/NativeQueryRunnerUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ public class NativeQueryRunnerUtils
2626
{
2727
private NativeQueryRunnerUtils() {}
2828

29-
public static Map<String, String> getNativeWorkerHiveProperties(String storageFormat)
29+
public static Map<String, String> getNativeWorkerHiveProperties()
3030
{
31-
return ImmutableMap.of("hive.storage-format", storageFormat,
32-
"hive.pushdown-filter-enabled", "true",
33-
"hive.parquet.pushdown-filter-enabled", "true",
31+
return ImmutableMap.of("hive.parquet.pushdown-filter-enabled", "true",
3432
"hive.orc-compression-codec", "ZSTD");
3533
}
3634

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/PrestoNativeQueryRunnerUtils.java

Lines changed: 238 additions & 351 deletions
Large diffs are not rendered by default.

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestNativeHistoryBasedStatsTracking.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ public class TestNativeHistoryBasedStatsTracking
3737
protected QueryRunner createQueryRunner()
3838
throws Exception
3939
{
40-
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(true);
40+
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
41+
.setAddStorageFormatToPath(true)
42+
.setUseThrift(true)
43+
.build();
4144
}
4245

4346
@BeforeMethod(alwaysRun = true)

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestNativePlanValidation.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ public class TestNativePlanValidation
1919
{
2020
protected QueryRunner createQueryRunner() throws Exception
2121
{
22-
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(false, true);
22+
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
23+
.setAddStorageFormatToPath(true)
24+
.setFailOnNestedLoopJoin(true)
25+
.build();
2326
}
2427
}

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeAggregations.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ public class TestPrestoNativeAggregations
2222
@Override
2323
protected QueryRunner createQueryRunner() throws Exception
2424
{
25-
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(false);
25+
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
26+
.setAddStorageFormatToPath(true)
27+
.build();
2628
}
2729

2830
@Override
2931
protected ExpectedQueryRunner createExpectedQueryRunner() throws Exception
3032
{
31-
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
33+
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
34+
.setAddStorageFormatToPath(true)
35+
.build();
3236
}
3337
}

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeArrayFunctionQueries.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ public class TestPrestoNativeArrayFunctionQueries
2222
@Override
2323
protected QueryRunner createQueryRunner() throws Exception
2424
{
25-
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(false);
25+
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
26+
.setAddStorageFormatToPath(true)
27+
.build();
2628
}
2729

2830
@Override
2931
protected ExpectedQueryRunner createExpectedQueryRunner() throws Exception
3032
{
31-
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
33+
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
34+
.setAddStorageFormatToPath(true)
35+
.build();
3236
}
3337
}

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeAsyncDataCacheCleanupAPI.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,21 @@ public class TestPrestoNativeAsyncDataCacheCleanupAPI
4343
@Override
4444
protected QueryRunner createQueryRunner() throws Exception
4545
{
46-
return PrestoNativeQueryRunnerUtils.createQueryRunner(true, false, true, true);
46+
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
47+
.setCacheMaxSize(4096)
48+
.setUseThrift(true)
49+
.setAddStorageFormatToPath(true)
50+
.setEnableRuntimeMetricsCollection(true)
51+
.setEnableSsdCache(true)
52+
.build();
4753
}
4854

4955
@Override
5056
protected ExpectedQueryRunner createExpectedQueryRunner() throws Exception
5157
{
52-
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
58+
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
59+
.setAddStorageFormatToPath(true)
60+
.build();
5361
}
5462

5563
@Override

presto-native-execution/src/test/java/com/facebook/presto/nativeworker/TestPrestoNativeBitwiseFunctionQueries.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ public class TestPrestoNativeBitwiseFunctionQueries
2222
@Override
2323
protected QueryRunner createQueryRunner() throws Exception
2424
{
25-
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(false);
25+
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
26+
.setAddStorageFormatToPath(true)
27+
.build();
2628
}
2729

2830
@Override
2931
protected ExpectedQueryRunner createExpectedQueryRunner() throws Exception
3032
{
31-
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
33+
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
34+
.setAddStorageFormatToPath(true)
35+
.build();
3236
}
3337
}

0 commit comments

Comments
 (0)