Skip to content

Commit d4fa39b

Browse files
ilicmarkodbyhuang-db
authored andcommitted
[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 apache#51060 from ilicmarkodb/fix_error. Authored-by: ilicmarkodb <marko.ilic@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
1 parent 144ec30 commit d4fa39b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ApplyDefaultCollationToStringType.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.apache.spark.sql.catalyst.analysis
1919

20+
import scala.util.control.NonFatal
21+
2022
import org.apache.spark.sql.catalyst.expressions.{Cast, DefaultStringProducingExpression, Expression, Literal, SubqueryExpression}
2123
import org.apache.spark.sql.catalyst.plans.logical.{AddColumns, AlterColumns, AlterColumnSpec, AlterViewAs, ColumnDefinition, CreateTable, CreateTempView, CreateView, LogicalPlan, QualifiedColType, ReplaceColumns, ReplaceTable, TableSpec, V2CreateTablePlan}
2224
import org.apache.spark.sql.catalyst.rules.Rule
@@ -140,7 +142,7 @@ object ApplyDefaultCollationToStringType extends Rule[LogicalPlan] {
140142
other
141143
}
142144
} catch {
143-
case _: NoSuchNamespaceException =>
145+
case NonFatal(_) =>
144146
plan
145147
}
146148
}

0 commit comments

Comments
 (0)