gatorsmile commented on a change in pull request #25107: [SPARK-28344][SQL]
detect ambiguous self-join and fail the query
URL: https://github.com/apache/spark/pull/25107#discussion_r310374831
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala
##########
@@ -1311,11 +1325,27 @@ class Dataset[T] private[sql](
if (sqlContext.conf.supportQuotedRegexColumnName) {
colRegex(colName)
} else {
- val expr = resolve(colName)
- Column(expr)
+ Column(addDataFrameIdToCol(resolve(colName)))
}
}
+ // Attach the dataset id and column position to the column reference, so
that we can detect
+ // ambiguous self-join correctly.See the rule `DetectAmbbiguousSelfJoin`.
+ // This must be called before we return a `Column` that contains
`AttributeReference`.
Review comment:
Also, document these metadata will be removed in the rule
DetectAmbbiguousSelfJoin
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]