Skip to content

Commit 9d45430

Browse files
committed
rebase main
1 parent 828730a commit 9d45430

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
import org.apache.spark.sql.types.StructType;
3737
import org.junit.jupiter.api.Test;
3838

39+
/**
40+
* This integration directly performs operations using the SparkCatalog instance, instead of going
41+
* through Spark SQL interface. Some operations don't have an easy way to trigger through the
42+
* SparkSQL, for example, list nested namespaces.
43+
*/
3944
@QuarkusIntegrationTest
40-
public class SparkCatalogOperationsIT extends SparkIntegrationBase {
41-
/**
42-
* This integration directly performs operations using the SparkCatalog instance, instead of going
43-
* through Spark SQL interface. Some operations don't have an easy way to trigger through the
44-
* SparkSQL, for example, list nested namespaces.
45-
*/
45+
public class PolarisSparkCatalogIT extends SparkIntegrationBase {
4646
private static StructType schema = new StructType().add("id", "long").add("name", "string");
4747

4848
@Test
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.junit.jupiter.api.Test;
2727

2828
@QuarkusIntegrationTest
29-
public class SparkIcebergCatalogIT extends SparkIntegrationBase {
29+
public class SparkIcebergIT extends SparkIntegrationBase {
3030
@Test
3131
public void testNamespaces() {
3232
List<Object[]> namespaces = sql("SHOW NAMESPACES");
@@ -99,11 +99,12 @@ public void renameView() {
9999
String renamedView = "renamedView";
100100
sql("CREATE VIEW %s AS SELECT 1 AS id", viewName);
101101
List<Object[]> views = sql("SHOW VIEWS");
102+
assertThat(views.size()).isEqualTo(1);
102103
assertThat(views).contains(new Object[] {"ns", viewName, false});
103104

104-
// TODO: update this test once table related operations are supported
105-
// spark view rename triggers a loadTable underneath
106-
assertThatThrownBy(() -> sql("ALTER VIEW %s RENAME TO %s", viewName, renamedView))
107-
.isInstanceOf(UnsupportedOperationException.class);
105+
sql("ALTER VIEW %s RENAME TO %s", viewName, renamedView);
106+
views = sql("SHOW VIEWS");
107+
assertThat(views.size()).isEqualTo(1);
108+
assertThat(views).contains(new Object[] {"ns", renamedView, false});
108109
}
109110
}

plugins/spark/v3.5/integration/src/intTest/java/org/apache/polaris/spark/quarkus/it/SparkIntegrationBase.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ protected SparkSession.Builder withCatalog(SparkSession.Builder builder, String
3838
.config(
3939
String.format("spark.sql.catalog.%s", catalogName),
4040
"org.apache.polaris.spark.SparkCatalog")
41+
.config(
42+
"spark.sql.extensions",
43+
"org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions")
4144
.config("spark.sql.warehouse.dir", warehouseDir.toString())
4245
.config(String.format("spark.sql.catalog.%s.type", catalogName), "rest")
4346
.config(

settings.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ for (sparkVersion in sparkVersions) {
7474
val sparkArtifactId = "polaris-spark-${sparkVersion}_${scalaVersion}"
7575
val sparkIntArtifactId = "polaris-spark-integration-${sparkVersion}_${scalaVersion}"
7676
polarisProject(
77-
"polaris-spark-${sparkVersion}_${scalaVersion}",
78-
file("${polarisSparkDir}/v${sparkVersion}/spark"),
77+
"polaris-spark-${sparkVersion}_${scalaVersion}",
78+
file("${polarisSparkDir}/v${sparkVersion}/spark"),
7979
)
8080
polarisProject(
81-
"polaris-spark-integration-${sparkVersion}_${scalaVersion}",
82-
file("${polarisSparkDir}/v${sparkVersion}/integration"),
81+
"polaris-spark-integration-${sparkVersion}_${scalaVersion}",
82+
file("${polarisSparkDir}/v${sparkVersion}/integration"),
8383
)
8484
if (first) {
8585
first = false

0 commit comments

Comments
 (0)