Skip to content

Commit 41016fe

Browse files
committed
[pos] Fix TestPrestoSparkNativeArrayFunctionQueries
1 parent 0788f73 commit 41016fe

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

presto-native-execution/src/test/java/com/facebook/presto/spark/TestPrestoSparkNativeArrayFunctionQueries.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,31 @@
1414
package com.facebook.presto.spark;
1515

1616
import com.facebook.presto.nativeworker.AbstractTestNativeArrayFunctionQueries;
17+
import com.facebook.presto.scalar.sql.SqlInvokedFunctionsPlugin;
1718
import com.facebook.presto.testing.ExpectedQueryRunner;
1819
import com.facebook.presto.testing.QueryRunner;
19-
import org.testng.annotations.Ignore;
2020

2121
public class TestPrestoSparkNativeArrayFunctionQueries
2222
extends AbstractTestNativeArrayFunctionQueries
2323
{
2424
@Override
2525
protected QueryRunner createQueryRunner()
2626
{
27-
return PrestoSparkNativeQueryRunnerUtils.createHiveRunner();
27+
QueryRunner queryRunner = PrestoSparkNativeQueryRunnerUtils.createHiveRunner();
28+
29+
// Install plugins needed for extra array functions.
30+
queryRunner.installPlugin(new SqlInvokedFunctionsPlugin());
31+
return queryRunner;
2832
}
2933

3034
@Override
3135
protected ExpectedQueryRunner createExpectedQueryRunner()
3236
throws Exception
3337
{
34-
return PrestoSparkNativeQueryRunnerUtils.createJavaQueryRunner();
35-
}
38+
QueryRunner queryRunner = PrestoSparkNativeQueryRunnerUtils.createJavaQueryRunner();
3639

37-
// Caused by: com.facebook.presto.sql.analyzer.SemanticException: line 1:32: Function array_sort_desc not registered
38-
@Override
39-
@Ignore
40-
public void testArraySort() {}
40+
// Install plugins needed for extra array functions.
41+
queryRunner.installPlugin(new SqlInvokedFunctionsPlugin());
42+
return queryRunner;
43+
}
4144
}

presto-native-execution/src/test/java/com/facebook/presto/spark/TestPrestoSparkNativeGeneralQueries.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.facebook.airlift.log.Level;
1717
import com.facebook.airlift.log.Logging;
1818
import com.facebook.presto.nativeworker.AbstractTestNativeGeneralQueries;
19+
import com.facebook.presto.scalar.sql.SqlInvokedFunctionsPlugin;
1920
import com.facebook.presto.testing.ExpectedQueryRunner;
2021
import com.facebook.presto.testing.QueryRunner;
2122
import org.testng.annotations.Ignore;
@@ -31,14 +32,22 @@ public class TestPrestoSparkNativeGeneralQueries
3132
@Override
3233
protected QueryRunner createQueryRunner()
3334
{
34-
return PrestoSparkNativeQueryRunnerUtils.createHiveRunner();
35+
QueryRunner queryRunner = PrestoSparkNativeQueryRunnerUtils.createHiveRunner();
36+
37+
// Install plugins needed for extra array functions.
38+
queryRunner.installPlugin(new SqlInvokedFunctionsPlugin());
39+
return queryRunner;
3540
}
3641

3742
@Override
3843
protected ExpectedQueryRunner createExpectedQueryRunner()
3944
throws Exception
4045
{
41-
return PrestoSparkNativeQueryRunnerUtils.createJavaQueryRunner();
46+
QueryRunner queryRunner = PrestoSparkNativeQueryRunnerUtils.createJavaQueryRunner();
47+
48+
// Install plugins needed for extra array functions.
49+
queryRunner.installPlugin(new SqlInvokedFunctionsPlugin());
50+
return queryRunner;
4251
}
4352

4453
@Override
@@ -107,18 +116,8 @@ public void testRowWiseExchange() {}
107116
@Ignore
108117
public void testAnalyzeStatsOnDecimals() {}
109118

110-
//Caused by: com.facebook.presto.sql.analyzer.SemanticException: line 1:31: Function array_duplicates not registered
111-
@Override
112-
@Ignore
113-
public void testArrayAndMapFunctions() {}
114-
115119
// VeloxRuntimeError: it != connectors().end() Connector with ID 'hivecached' not registered
116120
@Override
117121
@Ignore
118122
public void testCatalogWithCacheEnabled() {}
119-
120-
// Caused by: com.facebook.presto.spi.PrestoException: Sampling function: key_sampling_percent not cannot be resolved
121-
@Override
122-
@Ignore
123-
public void testKeyBasedSamplingInlined() {}
124123
}

0 commit comments

Comments
 (0)