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

wenchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 3e7fd7e45759 [SPARK-52372][SQL] Fix error handling in 
`ApplyDefaultCollationToStringType`
3e7fd7e45759 is described below

commit 3e7fd7e45759315a9017074392497d0990da3df1
Author: ilicmarkodb <marko.i...@databricks.com>
AuthorDate: Mon Jun 2 13:04:49 2025 +0800

    [SPARK-52372][SQL] Fix error handling in `ApplyDefaultCollationToStringType`
    
    ### What changes were proposed in this pull request?
    Fix error handling in `ApplyDefaultCollationToStringType`. 
`loadNamespaceMetadata` can throw other errors which are not handled.
    
    ### Why are the changes needed?
    Potential bug fix.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    Existing tests.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No.
    
    Closes #51060 from ilicmarkodb/fix_error.
    
    Authored-by: ilicmarkodb <marko.i...@databricks.com>
    Signed-off-by: Wenchen Fan <wenc...@databricks.com>
---
 .../sql/catalyst/analysis/ApplyDefaultCollationToStringType.scala     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyDefaultCollationToStringType.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyDefaultCollationToStringType.scala
index 50a98ea9be68..8eacc38e0149 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyDefaultCollationToStringType.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyDefaultCollationToStringType.scala
@@ -17,6 +17,8 @@
 
 package org.apache.spark.sql.catalyst.analysis
 
+import scala.util.control.NonFatal
+
 import org.apache.spark.sql.catalyst.expressions.{Cast, 
DefaultStringProducingExpression, Expression, Literal, SubqueryExpression}
 import org.apache.spark.sql.catalyst.plans.logical.{AddColumns, AlterColumns, 
AlterColumnSpec, AlterViewAs, ColumnDefinition, CreateTable, CreateTempView, 
CreateView, LogicalPlan, QualifiedColType, ReplaceColumns, ReplaceTable, 
TableSpec, V2CreateTablePlan}
 import org.apache.spark.sql.catalyst.rules.Rule
@@ -140,7 +142,7 @@ object ApplyDefaultCollationToStringType extends 
Rule[LogicalPlan] {
           other
       }
     } catch {
-      case _: NoSuchNamespaceException =>
+      case NonFatal(_) =>
         plan
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to