beliefer commented on code in PR #31337:
URL: https://github.com/apache/spark/pull/31337#discussion_r1416511541
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/BoundAttribute.scala:
##########
@@ -72,17 +71,16 @@ 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 new IllegalStateException(
+ s"Couldn't find $a in ${input.attrs.mkString("[", ",", "]")}")
Review Comment:
I guess we should use internal error too. At that time, we didn't have this
understanding yet.
--
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]