This is an automated email from the ASF dual-hosted git repository.

etudenhoefner pushed a commit to branch spark-fix-npe-in-test
in repository https://gitbox.apache.org/repos/asf/iceberg.git

commit 0a126549a5e1e0cab4b105fbae6c1603edf24e81
Author: Eduard Tudenhoefner <[email protected]>
AuthorDate: Wed Feb 7 09:47:31 2024 +0100

    Spark: Avoid NPE when catalog config doesn't have "type" set
    
    We do the same check in `SparkTestBaseWithCatalog` to avoid a potential NPE 
when a catalog configuration doesn't have the `type` set
---
 .../src/test/java/org/apache/iceberg/spark/TestBaseWithCatalog.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestBaseWithCatalog.java
 
b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestBaseWithCatalog.java
index be0d8c6439..c3c958abf0 100644
--- 
a/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestBaseWithCatalog.java
+++ 
b/spark/v3.5/spark/src/test/java/org/apache/iceberg/spark/TestBaseWithCatalog.java
@@ -101,7 +101,7 @@ public abstract class TestBaseWithCatalog extends TestBase {
     catalogConfig.forEach(
         (key, value) -> spark.conf().set("spark.sql.catalog." + catalogName + 
"." + key, value));
 
-    if (catalogConfig.get("type").equalsIgnoreCase("hadoop")) {
+    if ("hadoop".equalsIgnoreCase(catalogConfig.get("type"))) {
       spark.conf().set("spark.sql.catalog." + catalogName + ".warehouse", 
"file:" + warehouse);
     }
 

Reply via email to