beliefer commented on a change in pull request #31337:
URL: https://github.com/apache/spark/pull/31337#discussion_r573417689
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/BoundAttribute.scala
##########
@@ -72,17 +72,15 @@ object BindReferences extends Logging {
input: AttributeSeq,
allowFailures: Boolean = false): A = {
expression.transform { case a: AttributeReference =>
- attachTree(a, "Binding attribute") {
- val ordinal = input.indexOf(a.exprId)
- if (ordinal == -1) {
- if (allowFailures) {
- a
- } else {
- sys.error(s"Couldn't find $a in ${input.attrs.mkString("[", ",",
"]")}")
- }
+ val ordinal = input.indexOf(a.exprId)
+ if (ordinal == -1) {
+ if (allowFailures) {
+ a
} else {
- BoundReference(ordinal, a.dataType, input(ordinal).nullable)
+ throw
QueryExecutionErrors.cannotFindExpressionInInputAttributesError(a, input)
Review comment:
Yeah. It hears more reasonable.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]