You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/10/01 18:18:10 UTC

[GitHub] [spark] amaliujia commented on a diff in pull request #38039: [SPARK-40603][SQL] Throw the original error from catalog implementations

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org