amaliujia commented on code in PR #38039:
URL: https://github.com/apache/spark/pull/38039#discussion_r985129333


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -126,26 +126,11 @@ trait CheckAnalysis extends PredicateHelper with 
LookupCatalog {
         throw new IllegalStateException(
           "[BUG] logical plan should not have output of char/varchar type: " + 
leaf)
 
-      case u: UnresolvedNamespace =>
-        u.failAnalysis(s"Namespace not found: ${u.multipartIdentifier.quoted}")
-
-      case u: UnresolvedTable =>
-        u.failAnalysis(s"Table not found: ${u.multipartIdentifier.quoted}")
-
-      case u: UnresolvedView =>
-        u.failAnalysis(s"View not found: ${u.multipartIdentifier.quoted}")
-
-      case u: UnresolvedTableOrView =>
-        val viewStr = if (u.allowTempView) "view" else "permanent view"
-        u.failAnalysis(
-          s"Table or $viewStr not found: ${u.multipartIdentifier.quoted}")

Review Comment:
   I am thinking this is because now we throw the exceptions from catalog 
implementation thus such unresolved namespace/table/view/function will be 
caught already in the earlier stage. So literally this PR moves to a fail-fast 
approach.
   
   
   This makes sense to me as the giant `CheckAnalysis` sometime cannot give the 
error message I expect as there is an ordering of error check here. `Fail-fast` 
and `Fail-at-right-place` can improve it.
   
   
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to