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
5 changes: 5 additions & 0 deletions .github/workflows/prestocpp-linux-build-and-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ jobs:
prestocpp-linux-presto-native-tests:
needs: prestocpp-linux-build-for-test
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
storage-format: [ "PARQUET", "DWRF" ]
container:
image: prestodb/presto-native-dependency:0.292-20250204112033-cf8ba84
env:
Expand Down Expand Up @@ -230,6 +234,7 @@ jobs:
mvn test \
${MAVEN_TEST} \
-pl 'presto-native-tests' \
-DstorageFormat=${{ matrix.storage-format }} \
-Dtest="${TESTCLASSES}" \
-DPRESTO_SERVER=${PRESTO_SERVER_PATH} \
-DDATA_DIR=${RUNNER_TEMP} \
Expand Down
7 changes: 5 additions & 2 deletions presto-native-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ The following command can be used to run all tests in this module:
```
mvn test
-pl 'presto-native-tests'
-DstorageFormat="PARQUET"
-Dtest="com.facebook.presto.nativetests.Test*"
-Duser.timezone=America/Bahia_Banderas
-DPRESTO_SERVER=${PRESTO_HOME}/presto-native-execution/cmake-build-debug/presto_cpp/main/presto_server
-DWORKER_COUNT=${WORKER_COUNT} -T1C
```
Please update JVM argument `PRESTO_SERVER` to point to the Presto C++ worker
binary `presto_server`.
Update the following JVM arguments:
1. `PRESTO_SERVER`: Points to the Presto C++ worker binary, `presto_server`.
2. `storageFormat`: File format of TPC-H tables used in tests, `DWRF` and
`PARQUET` formats are supported.

## Adding new tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.facebook.presto.tests.AbstractTestEngineOnlyQueries;
import com.google.common.collect.ImmutableMap;
import org.intellij.lang.annotations.Language;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

import java.time.LocalDate;
Expand All @@ -34,20 +35,26 @@ public class TestDistributedEngineOnlyQueries
{
private static final String timeTypeUnsupportedError = ".*Failed to parse type \\[time.*";

private static final String storageFormat = "PARQUET";

@Parameters("storageFormat")
@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), storageFormat);
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat"));
}

@Parameters("storageFormat")
@Override
protected void createTables()
{
try {
String storageFormat = System.getProperty("storageFormat");
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.createJavaQueryRunner(storageFormat);
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, false);
if (storageFormat.equals("DWRF")) {
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, true);
}
else {
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, false);
}
javaQueryRunner.close();
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,32 @@
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.tests.AbstractTestOrderByQueries;
import com.google.common.collect.ImmutableMap;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

public class TestOrderByQueries
extends AbstractTestOrderByQueries
{
private static final String storageFormat = "PARQUET";

@Parameters("storageFormat")
@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), storageFormat);
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat"));
}

@Parameters("storageFormat")
@Override
protected void createTables()
{
try {
String storageFormat = System.getProperty("storageFormat");
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.createJavaQueryRunner(storageFormat);
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, false);
if (storageFormat.equals("DWRF")) {
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, true);
}
else {
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, false);
}
javaQueryRunner.close();
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,31 @@
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.tests.AbstractTestRepartitionQueries;
import com.google.common.collect.ImmutableMap;
import org.testng.annotations.Parameters;

public class TestRepartitionQueries
extends AbstractTestRepartitionQueries
{
private static final String storageFormat = "PARQUET";

@Parameters("storageFormat")
@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), storageFormat);
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat"));
}

@Parameters("storageFormat")
@Override
protected void createTables()
{
try {
String storageFormat = System.getProperty("storageFormat");
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.createJavaQueryRunner(storageFormat);
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, false);
if (storageFormat.equals("DWRF")) {
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, true);
}
else {
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, false);
}
javaQueryRunner.close();
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,34 @@
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.tests.AbstractTestRepartitionQueries;
import com.google.common.collect.ImmutableMap;
import org.testng.annotations.Parameters;

public class TestRepartitionQueriesWithSmallPages
extends AbstractTestRepartitionQueries
{
private static final String storageFormat = "PARQUET";

@Parameters("storageFormat")
@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(
// Use small SerializedPages to force flushing
ImmutableMap.of("driver.max-page-partitioning-buffer-size", "200B"), storageFormat);
ImmutableMap.of("driver.max-page-partitioning-buffer-size", "200B"),
System.getProperty("storageFormat"));
}

@Parameters("storageFormat")
@Override
protected void createTables()
{
try {
String storageFormat = System.getProperty("storageFormat");
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.createJavaQueryRunner(storageFormat);
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, false);
if (storageFormat.equals("DWRF")) {
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, true);
}
else {
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, false);
}
javaQueryRunner.close();
}
catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,34 @@
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.tests.AbstractTestWindowQueries;
import com.google.common.collect.ImmutableMap;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

public class TestWindowQueries
extends AbstractTestWindowQueries
{
private static final String frameTypeDiffersError = ".*Window frame of type RANGE does not match types of the ORDER BY and frame column.*";

private String storageFormat = "PARQUET";

@Parameters("storageFormat")
@Override
protected QueryRunner createQueryRunner() throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), storageFormat);
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat"));
}

@Parameters("storageFormat")
@Override
protected void createTables()
{
try {
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.createJavaQueryRunner("PARQUET");
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, false);
String storageFormat = System.getProperty("storageFormat");
QueryRunner javaQueryRunner = PrestoNativeQueryRunnerUtils.createJavaQueryRunner(storageFormat);
if (storageFormat.equals("DWRF")) {
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, true);
}
else {
NativeQueryRunnerUtils.createAllTables(javaQueryRunner, false);
}
javaQueryRunner.close();
}
catch (Exception e) {
Expand Down
Loading