FANNG1 commented on code in PR #5423:
URL: https://github.com/apache/gravitino/pull/5423#discussion_r1825831858


##########
iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRestKerberosHiveCatalogIT.java:
##########
@@ -149,12 +152,50 @@ Map<String, String> getCatalogConfig() {
     return configMap;
   }
 
-  private static boolean isEmbedded() {
-    String mode =
-        System.getProperty(ITUtils.TEST_MODE) == null
-            ? ITUtils.EMBEDDED_TEST_MODE
-            : System.getProperty(ITUtils.TEST_MODE);
+  protected void initSparkEnv() {
+    int port = getServerPort();
+    LOG.info("Iceberg REST server port:{}", port);
+    String icebergRESTUri = String.format("http://127.0.0.1:%d/iceberg/";, 
port);
+    SparkConf sparkConf =
+        new SparkConf()
+            .set(
+                "spark.sql.extensions",
+                
"org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions")
+            .set("spark.sql.catalog.rest", 
"org.apache.iceberg.spark.SparkCatalog")
+            .set("spark.sql.catalog.rest.type", "rest")
+            .set("spark.sql.catalog.rest.uri", icebergRESTUri)
+            .set("spark.locality.wait.node", "0");
+
+    if (supportsCredentialVending()) {
+      sparkConf.set(
+          "spark.sql.catalog.rest.header.X-Iceberg-Access-Delegation", 
"vended-credentials");
+    }
+
+    // Login kerberos and use the users to execute the spark job.
+    try {
+      Configuration configuration = new Configuration();
+      configuration.set("hadoop.security.authentication", "kerberos");

Review Comment:
   please set all configurations in spark config.



-- 
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