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

etudenhoefner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 0cab58b04f Spark: Avoid NPE when catalog config doesn't have "type" 
set (#9676)
0cab58b04f is described below

commit 0cab58b04f4c86e556ff2f4aea7a9dbeee801ce7
Author: Eduard Tudenhoefner <[email protected]>
AuthorDate: Wed Feb 7 10:35:35 2024 +0100

    Spark: Avoid NPE when catalog config doesn't have "type" set (#9676)
    
    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