You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2023/08/30 04:48:33 UTC
[GitHub] [spark] cloud-fan commented on a diff in pull request #42729: [SPARK-45012][SQL] CheckAnalysis should throw inlined plan in AnalysisException
cloud-fan commented on code in PR #42729:
URL: https://github.com/apache/spark/pull/42729#discussion_r1309651400
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -154,10 +155,22 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog with QueryErrorsB
cteMap.values.foreach { case (relation, refCount, _) =>
// If a CTE relation is never used, it will disappear after inline. Here we explicitly check
// analysis for it, to make sure the entire query plan is valid.
- if (refCount == 0) checkAnalysis0(relation.child)
+ try {
+ if (refCount == 0) checkAnalysis0(relation.child)
+ } catch {
+ case e: AnalysisException =>
+ throw new ExtendedAnalysisException(e, relation.child)
+ }
+
}
// Inline all CTEs in the plan to help check query plan structures in subqueries.
- checkAnalysis0(inlineCTE(plan))
+ val inlinedPlan = inlineCTE(plan)
+ try {
+ checkAnalysis0(inlinedPlan)
+ } catch {
+ case e: AnalysisException =>
Review Comment:
nit: indentation is wrong here.
--
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