roryqi commented on code in PR #13569:
URL: https://github.com/apache/gravitino/pull/13569#discussion_r4292504699


##########
iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergExperimentalAuthorizationIT.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.iceberg.integration.test;
+
+import java.nio.file.Paths;
+import org.apache.gravitino.integration.test.util.TestDatabaseName;
+import org.apache.iceberg.IcebergBuild;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+
+/**
+ * Integration test for Spark authorization through the Iceberg REST service 
loaded from the
+ * experimental classpath.
+ *
+ * <p>The inherited tests exercise table creation, loading, updates, deletion, 
listing, renaming,
+ * nested namespaces, and table privilege enforcement against the experimental 
Iceberg artifacts.
+ */
+@Tag("gravitino-docker-test")
+public class IcebergExperimentalAuthorizationIT extends 
IcebergTableAuthorizationIT {
+
+  private static final String EXPERIMENTAL_SERVER_DIRECTORY = 
"iceberg-rest-experimental-server";
+
+  @BeforeAll
+  @Override
+  public void startIntegrationTest() throws Exception {
+    Assertions.assertEquals(
+        System.getProperty("datastratoIcebergVersion"),
+        IcebergBuild.version(),
+        "The experimental integration test must run with the Datastrato 
Iceberg runtime");

Review Comment:
   Fixed in b11979a73c. The test now pins and asserts 
IcebergBuild.gitCommitId(), so a future Apache Iceberg 1.13.0 release cannot 
satisfy the guard accidentally.



##########
iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergExperimentalAuthorizationIT.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.iceberg.integration.test;
+
+import java.nio.file.Paths;
+import org.apache.gravitino.integration.test.util.TestDatabaseName;
+import org.apache.iceberg.IcebergBuild;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Tag;
+
+/**
+ * Integration test for Spark authorization through the Iceberg REST service 
loaded from the
+ * experimental classpath.
+ *
+ * <p>The inherited tests exercise table creation, loading, updates, deletion, 
listing, renaming,
+ * nested namespaces, and table privilege enforcement against the experimental 
Iceberg artifacts.
+ */
+@Tag("gravitino-docker-test")
+public class IcebergExperimentalAuthorizationIT extends 
IcebergTableAuthorizationIT {
+
+  private static final String EXPERIMENTAL_SERVER_DIRECTORY = 
"iceberg-rest-experimental-server";
+
+  @BeforeAll
+  @Override
+  public void startIntegrationTest() throws Exception {
+    Assertions.assertEquals(
+        System.getProperty("datastratoIcebergVersion"),
+        IcebergBuild.version(),
+        "The experimental integration test must run with the Datastrato 
Iceberg runtime");
+
+    String rootDirectory = System.getenv("GRAVITINO_ROOT_DIR");
+    String experimentalServerHome =
+        Paths.get(rootDirectory, "iceberg", 
EXPERIMENTAL_SERVER_DIRECTORY).toString();
+    customConfigs.put(
+        "gravitino.iceberg-rest.classpath",
+        String.join(
+            ",",
+            Paths.get(experimentalServerHome, "build", "libs").toString(),
+            Paths.get(experimentalServerHome, "build", 
"dependencies").toString()));

Review Comment:
   Fixed in b11979a73c. The test now verifies the server startup log after 
launch. Both modes assert the pinned fork commit; deploy mode additionally 
requires the logged code source to contain iceberg-rest-experimental-server, 
which verifies the configured directory rather than only the test JVM classpath.



##########
iceberg/iceberg-rest-server/build.gradle.kts:
##########
@@ -27,8 +27,44 @@ plugins {
 val scalaVersion: String = project.properties["scalaVersion"] as? String ?: 
extra["defaultScalaVersion"].toString()
 val sparkVersion: String = libs.versions.spark34.get()
 val sparkMajorVersion: String = sparkVersion.substringBeforeLast(".")
+val experimentalSparkVersion: String = libs.versions.spark35.get()
+val experimentalSparkMajorVersion: String = 
experimentalSparkVersion.substringBeforeLast(".")
 val icebergVersion: String = libs.versions.iceberg.get()
+val datastratoIcebergVersion: String = libs.versions.datastrato.iceberg.get()
 val scalaCollectionCompatVersion: String = 
libs.versions.scala.collection.compat.get()
+val caffeineVersion: String = libs.versions.caffeine.get()
+val jacksonVersion: String = libs.versions.jackson.get()
+
+val experimentalTestRuntimeClasspath by configurations.creating {
+  extendsFrom(configurations.testRuntimeClasspath.get())

Review Comment:
   Fixed in b11979a73c. experimentalTestRuntimeClasspath now copies every 
attribute from testRuntimeClasspath and is explicitly resolvable but not 
consumable. The non-consumable flag also prevents it from becoming an ambiguous 
project runtime variant. The 16-test embedded suite passes.



##########
iceberg/iceberg-rest-server/build.gradle.kts:
##########
@@ -27,8 +27,44 @@ plugins {
 val scalaVersion: String = project.properties["scalaVersion"] as? String ?: 
extra["defaultScalaVersion"].toString()
 val sparkVersion: String = libs.versions.spark34.get()
 val sparkMajorVersion: String = sparkVersion.substringBeforeLast(".")
+val experimentalSparkVersion: String = libs.versions.spark35.get()
+val experimentalSparkMajorVersion: String = 
experimentalSparkVersion.substringBeforeLast(".")
 val icebergVersion: String = libs.versions.iceberg.get()
+val datastratoIcebergVersion: String = libs.versions.datastrato.iceberg.get()
 val scalaCollectionCompatVersion: String = 
libs.versions.scala.collection.compat.get()
+val caffeineVersion: String = libs.versions.caffeine.get()
+val jacksonVersion: String = libs.versions.jackson.get()
+
+val experimentalTestRuntimeClasspath by configurations.creating {
+  extendsFrom(configurations.testRuntimeClasspath.get())
+  resolutionStrategy {
+    force(
+      "com.github.ben-manes.caffeine:caffeine:$caffeineVersion",
+      "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion",
+      "com.fasterxml.jackson.core:jackson-core:$jacksonVersion",
+      "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
+      "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion",
+      "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion"
+    )
+    eachDependency {
+      if (requested.group == "org.apache.spark") {
+        useVersion(experimentalSparkVersion)
+        because("The experimental Iceberg Spark runtime is published for Spark 
3.5")

Review Comment:
   Added an inline explanation in b11979a73c and updated the PR description to 
state that Spark 3.5 is required because the fork does not publish a Spark 3.4 
runtime.



##########
iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergTableAuthorizationIT.java:
##########
@@ -272,7 +272,7 @@ void testLoadTable() {
     setSchemaOwner(NORMAL_USER);
     Assertions.assertDoesNotThrow(() -> sql("DESC TABLE %s", tableName));
     // With ownership: non-existent table returns 404 (AnalysisException)
-    Assertions.assertThrowsExactly(
+    Assertions.assertThrows(

Review Comment:
   Fixed in b11979a73c with a protected assertion hook. The stable Spark 3.4 
suite keeps assertThrowsExactly, while only the experimental Spark 3.5 subclass 
accepts an AnalysisException subtype.



##########
LICENSE.bin:
##########
@@ -212,6 +212,7 @@
    Apache DataSketches Java
    Apache DataSketches Memory
    Apache Iceberg
+   Datastrato Experimental Apache Iceberg

Review Comment:
   Renamed the LICENSE.bin entry in b11979a73c to Datastrato Experimental 
Iceberg (com.datastrato).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to