Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public static void main(String[] args)
Logging.initialize();

// Create tables before launching distributed runner.
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.createJavaQueryRunner(false);
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder().build();
NativeQueryRunnerUtils.createAllTables(javaQueryRunner);
javaQueryRunner.close();

// Launch distributed runner.
DistributedQueryRunner queryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.createQueryRunner(false, false, false, false);
DistributedQueryRunner queryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder().build();
Thread.sleep(10);
Logger log = Logger.get(DistributedQueryRunner.class);
log.info("======== SERVER STARTED ========");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ public static void main(String[] args)
Logging.initialize();

// Create tables before launching distributed runner.
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.createJavaIcebergQueryRunner(false);
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.javaIcebergQueryRunnerBuilder().build();
NativeQueryRunnerUtils.createAllIcebergTables(javaQueryRunner);
javaQueryRunner.close();

// Launch distributed runner.
DistributedQueryRunner queryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.createNativeIcebergQueryRunner(true, false);
DistributedQueryRunner queryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.nativeIcebergQueryRunnerBuilder()
.setUseThrift(true)
.build();
Thread.sleep(10);
Logger log = Logger.get(DistributedQueryRunner.class);
log.info("======== SERVER STARTED ========");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ public class NativeQueryRunnerUtils
{
private NativeQueryRunnerUtils() {}

public static Map<String, String> getNativeWorkerHiveProperties(String storageFormat)
public static Map<String, String> getNativeWorkerHiveProperties()
{
return ImmutableMap.of("hive.storage-format", storageFormat,
"hive.pushdown-filter-enabled", "true",
"hive.parquet.pushdown-filter-enabled", "true",
return ImmutableMap.of("hive.parquet.pushdown-filter-enabled", "true",
"hive.orc-compression-codec", "ZSTD");
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public class TestNativeHistoryBasedStatsTracking
protected QueryRunner createQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(true);
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.setUseThrift(true)
.build();
}

@BeforeMethod(alwaysRun = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public class TestNativePlanValidation
{
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(false, true);
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.setFailOnNestedLoopJoin(true)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ public class TestPrestoNativeAggregations
@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(false);
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}

@Override
protected ExpectedQueryRunner createExpectedQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ public class TestPrestoNativeArrayFunctionQueries
@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(false);
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}

@Override
protected ExpectedQueryRunner createExpectedQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,21 @@ public class TestPrestoNativeAsyncDataCacheCleanupAPI
@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createQueryRunner(true, false, true, true);
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setCacheMaxSize(4096)
.setUseThrift(true)
.setAddStorageFormatToPath(true)
.setEnableRuntimeMetricsCollection(true)
.setEnableSsdCache(true)
.build();
}

@Override
protected ExpectedQueryRunner createExpectedQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ public class TestPrestoNativeBitwiseFunctionQueries
@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(false);
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}

@Override
protected ExpectedQueryRunner createExpectedQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,26 @@
public class TestPrestoNativeCtasQueriesParquet
extends AbstractTestNativeCtasQueries
{
private final String storageFormat = "PARQUET";

@Override
protected QueryRunner createQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(true, "PARQUET");
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setStorageFormat(storageFormat)
.setAddStorageFormatToPath(true)
.setUseThrift(true)
.build();
}

@Override
protected ExpectedQueryRunner createExpectedQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner("PARQUET");
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
.setStorageFormat(storageFormat)
.setAddStorageFormatToPath(true)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.facebook.presto.Session;
import com.facebook.presto.testing.QueryRunner;
import com.google.common.collect.ImmutableMap;
import org.testng.annotations.Test;

import static com.facebook.presto.SystemSessionProperties.CTE_FILTER_AND_PROJECTION_PUSHDOWN_ENABLED;
Expand All @@ -27,18 +28,33 @@
public class TestPrestoNativeCteExecutionParquet
extends AbstractTestNativeCteExecution
{
private final String storageFormat = "PARQUET";

@Override
protected QueryRunner createQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeCteQueryRunner(true, "PARQUET");
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setStorageFormat(this.storageFormat)
.setAddStorageFormatToPath(true)
.setUseThrift(true)
.setExtraProperties(ImmutableMap.of("query.cte-partitioning-provider-catalog", "hive"))
.setHiveProperties(ImmutableMap.<String, String>builder()
.put("hive.enable-parquet-dereference-pushdown", "true")
.put("hive.temporary-table-compression-codec", "NONE")
.put("hive.temporary-table-storage-format", this.storageFormat)
.build())
.build();
}

@Override
protected QueryRunner createExpectedQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner("PARQUET");
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
.setStorageFormat(this.storageFormat)
.setAddStorageFormatToPath(true)
.build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ public class TestPrestoNativeGeneralQueriesJSON
protected QueryRunner createQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(false);
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}

@Override
protected ExpectedQueryRunner createExpectedQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@ public class TestPrestoNativeGeneralQueriesThrift
protected QueryRunner createQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(true);
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.setUseThrift(true)
.build();
}

@Override
protected ExpectedQueryRunner createExpectedQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package com.facebook.presto.nativeworker;

import com.facebook.presto.spi.NodeState;
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.tests.DistributedQueryRunner;
import org.testng.annotations.Test;

Expand All @@ -26,8 +25,10 @@ public class TestPrestoNativeGracefulShutdown
@Test
public void testGracefulShutdown() throws Exception
{
QueryRunner queryRunner = PrestoNativeQueryRunnerUtils.createNativeQueryRunner(true);
DistributedQueryRunner distributedQueryRunner = (DistributedQueryRunner) queryRunner;
DistributedQueryRunner distributedQueryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.setUseThrift(true)
.build();

int responseCode = distributedQueryRunner.sendWorkerRequest(0, "INVALID_BODY");
assertEquals(responseCode, 400, "Expected a 400 Bad Request response for invalid body");
Expand All @@ -40,6 +41,6 @@ public void testGracefulShutdown() throws Exception
NodeState state = distributedQueryRunner.getWorkerInfoState(0);
assertEquals(state.getValue(), SHUTTING_DOWN.getValue());

queryRunner.close();
distributedQueryRunner.close();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ protected void createTables()
protected QueryRunner createQueryRunner()
throws Exception
{
QueryRunner queryRunner = PrestoNativeQueryRunnerUtils.createNativeQueryRunner(true);
QueryRunner queryRunner = PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.setUseThrift(true)
.build();
queryRunner.installPlugin(new Plugin()
{
@Override
Expand All @@ -71,7 +74,9 @@ public Iterable<HistoryBasedPlanStatisticsProvider> getHistoryBasedPlanStatistic
protected ExpectedQueryRunner createExpectedQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
.setAddStorageFormatToPath(true)
.build();
}

@BeforeMethod(alwaysRun = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,24 @@
public class TestPrestoNativeHiveExternalTableTpchQueriesParquet
extends AbstractTestNativeHiveExternalTableTpchQueries
{
private final String storageFormat = "PARQUET";

@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(true, "PARQUET");
return PrestoNativeQueryRunnerUtils.nativeHiveQueryRunnerBuilder()
.setStorageFormat(storageFormat)
.setAddStorageFormatToPath(true)
.setUseThrift(true)
.build();
}

@Override
protected ExpectedQueryRunner createExpectedQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner("PARQUET");
return PrestoNativeQueryRunnerUtils.javaHiveQueryRunnerBuilder()
.setStorageFormat(storageFormat)
.setAddStorageFormatToPath(true)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.facebook.presto.tests.AbstractTestQueryFramework;
import org.testng.annotations.Test;

import static com.facebook.presto.nativeworker.PrestoNativeQueryRunnerUtils.ICEBERG_DEFAULT_STORAGE_FORMAT;
import static java.lang.String.format;
import static org.testng.Assert.assertEquals;

Expand All @@ -28,14 +29,20 @@ public class TestPrestoNativeIcebergGeneralQueries
protected QueryRunner createQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeIcebergQueryRunner(false, true);
return PrestoNativeQueryRunnerUtils.nativeIcebergQueryRunnerBuilder()
.setStorageFormat(ICEBERG_DEFAULT_STORAGE_FORMAT)
.setAddStorageFormatToPath(true)
.build();
}

@Override
protected ExpectedQueryRunner createExpectedQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaIcebergQueryRunner(true);
return PrestoNativeQueryRunnerUtils.javaIcebergQueryRunnerBuilder()
.setStorageFormat(ICEBERG_DEFAULT_STORAGE_FORMAT)
.setAddStorageFormatToPath(true)
.build();
}

@Override
Expand Down
Loading
Loading