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 acd0244e054f5..ed6da41339c42 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 @@ -424,7 +424,7 @@ public static QueryRunner createNativeQueryRunner(String remoteFunctionServerUds return createNativeQueryRunner(false, DEFAULT_STORAGE_FORMAT, Optional.ofNullable(remoteFunctionServerUds), false, false, false, false, false); } - public static QueryRunner createNativeQueryRunner(Map extraProperties, String storageFormat) + public static QueryRunner createNativeQueryRunner(Map extraProperties, String storageFormat, boolean isCoordinatorSidecarEnabled) throws Exception { int cacheMaxSize = 0; @@ -439,7 +439,7 @@ public static QueryRunner createNativeQueryRunner(Map extraPrope storageFormat, true, false, - false, + isCoordinatorSidecarEnabled, false, false, false, diff --git a/presto-native-tests/pom.xml b/presto-native-tests/pom.xml index ac0e0ff548421..5bce5b0c0daa8 100644 --- a/presto-native-tests/pom.xml +++ b/presto-native-tests/pom.xml @@ -54,6 +54,19 @@ com.google.guava guava + + com.facebook.presto + presto-native-sidecar-plugin + test + + + + com.facebook.presto + presto-native-sidecar-plugin + test + test-jar + ${project.version} + diff --git a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestDistributedEngineOnlyQueries.java b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestDistributedEngineOnlyQueries.java index e0ae26b31fd65..4ce04883aab06 100644 --- a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestDistributedEngineOnlyQueries.java +++ b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestDistributedEngineOnlyQueries.java @@ -28,18 +28,21 @@ import java.time.format.DateTimeFormatter; import java.util.Objects; +import static com.facebook.presto.sidecar.NativeSidecarPluginQueryRunnerUtils.setupNativeSidecarPlugin; import static com.google.common.base.Preconditions.checkState; public class TestDistributedEngineOnlyQueries extends AbstractTestEngineOnlyQueries { - private static final String timeTypeUnsupportedError = ".*Failed to parse type \\[time.*"; + private static final String timeTypeUnsupportedError = "^Unknown type time.*"; @Parameters("storageFormat") @Override protected QueryRunner createQueryRunner() throws Exception { - return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat")); + QueryRunner queryRunner = PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat"), true); + setupNativeSidecarPlugin(queryRunner); + return queryRunner; } @Parameters("storageFormat") diff --git a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestOrderByQueries.java b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestOrderByQueries.java index ec8f32b2261fd..c20dd16205140 100644 --- a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestOrderByQueries.java +++ b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestOrderByQueries.java @@ -21,6 +21,8 @@ import org.testng.annotations.Parameters; import org.testng.annotations.Test; +import static com.facebook.presto.sidecar.NativeSidecarPluginQueryRunnerUtils.setupNativeSidecarPlugin; + public class TestOrderByQueries extends AbstractTestOrderByQueries { @@ -28,7 +30,9 @@ public class TestOrderByQueries @Override protected QueryRunner createQueryRunner() throws Exception { - return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat")); + QueryRunner queryRunner = PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat"), true); + setupNativeSidecarPlugin(queryRunner); + return queryRunner; } @Parameters("storageFormat") diff --git a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestRepartitionQueries.java b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestRepartitionQueries.java index ebc8f19105c09..a06607496ca7b 100644 --- a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestRepartitionQueries.java +++ b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestRepartitionQueries.java @@ -20,6 +20,8 @@ import com.google.common.collect.ImmutableMap; import org.testng.annotations.Parameters; +import static com.facebook.presto.sidecar.NativeSidecarPluginQueryRunnerUtils.setupNativeSidecarPlugin; + public class TestRepartitionQueries extends AbstractTestRepartitionQueries { @@ -27,7 +29,9 @@ public class TestRepartitionQueries @Override protected QueryRunner createQueryRunner() throws Exception { - return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat")); + QueryRunner queryRunner = PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat"), true); + setupNativeSidecarPlugin(queryRunner); + return queryRunner; } @Parameters("storageFormat") diff --git a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestRepartitionQueriesWithSmallPages.java b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestRepartitionQueriesWithSmallPages.java index 5e354f3cd3cf6..0f1155079af92 100644 --- a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestRepartitionQueriesWithSmallPages.java +++ b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestRepartitionQueriesWithSmallPages.java @@ -20,6 +20,8 @@ import com.google.common.collect.ImmutableMap; import org.testng.annotations.Parameters; +import static com.facebook.presto.sidecar.NativeSidecarPluginQueryRunnerUtils.setupNativeSidecarPlugin; + public class TestRepartitionQueriesWithSmallPages extends AbstractTestRepartitionQueries { @@ -27,10 +29,13 @@ public class TestRepartitionQueriesWithSmallPages @Override protected QueryRunner createQueryRunner() throws Exception { - return PrestoNativeQueryRunnerUtils.createNativeQueryRunner( + QueryRunner queryRunner = PrestoNativeQueryRunnerUtils.createNativeQueryRunner( // Use small SerializedPages to force flushing ImmutableMap.of("driver.max-page-partitioning-buffer-size", "200B"), - System.getProperty("storageFormat")); + System.getProperty("storageFormat"), + true); + setupNativeSidecarPlugin(queryRunner); + return queryRunner; } @Parameters("storageFormat") diff --git a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestWindowQueries.java b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestWindowQueries.java index 6f173e80419f8..62a88e205a75e 100644 --- a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestWindowQueries.java +++ b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestWindowQueries.java @@ -21,6 +21,8 @@ import org.testng.annotations.Parameters; import org.testng.annotations.Test; +import static com.facebook.presto.sidecar.NativeSidecarPluginQueryRunnerUtils.setupNativeSidecarPlugin; + public class TestWindowQueries extends AbstractTestWindowQueries { @@ -30,7 +32,9 @@ public class TestWindowQueries @Override protected QueryRunner createQueryRunner() throws Exception { - return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat")); + QueryRunner queryRunner = PrestoNativeQueryRunnerUtils.createNativeQueryRunner(ImmutableMap.of(), System.getProperty("storageFormat"), true); + setupNativeSidecarPlugin(queryRunner); + return queryRunner; } @Parameters("storageFormat")