-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-39488][SQL] Simplify the error handling of TempResolvedColumn #36809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5f98af3
00be1c6
fb48d3d
d9038f7
1dd5610
5d121d0
dd15e5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,8 +50,6 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog { | |
|
|
||
| val DATA_TYPE_MISMATCH_ERROR = TreeNodeTag[Boolean]("dataTypeMismatchError") | ||
|
|
||
| val DATA_TYPE_MISMATCH_ERROR_MESSAGE = TreeNodeTag[String]("dataTypeMismatchError") | ||
|
|
||
|
Comment on lines
-53
to
-54
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just to make sure this isn't related to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It was used to do error handling of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, I added this in #36746. It is not needed after this pr |
||
| protected def failAnalysis(msg: String): Nothing = { | ||
| throw new AnalysisException(msg) | ||
| } | ||
|
|
@@ -176,20 +174,7 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog { | |
| } | ||
| } | ||
|
|
||
| val expressions = getAllExpressions(operator) | ||
|
|
||
| expressions.foreach(_.foreachUp { | ||
| case e: Expression => | ||
| e.getTagValue(DATA_TYPE_MISMATCH_ERROR_MESSAGE) match { | ||
| case Some(message) => | ||
| e.failAnalysis(s"cannot resolve '${e.sql}' due to data type mismatch: $message" + | ||
| extraHintForAnsiTypeCoercionExpression(operator)) | ||
| case _ => | ||
| } | ||
| case _ => | ||
| }) | ||
|
|
||
| expressions.foreach(_.foreachUp { | ||
| getAllExpressions(operator).foreach(_.foreachUp { | ||
| case a: Attribute if !a.resolved => | ||
| val missingCol = a.sql | ||
| val candidates = operator.inputSet.toSeq.map(_.qualifiedName) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.