Github user nsyca commented on a diff in the pull request:
https://github.com/apache/spark/pull/14719#discussion_r80714835
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
---
@@ -1580,6 +1583,28 @@ class DataFrameSuite extends QueryTest with
SharedSQLContext {
assert(df.persist.take(1).apply(0).toSeq(100).asInstanceOf[Long] ==
100)
}
+ test("""SPARK-17154: df("column_name") should return correct result when
we do self-join""") {
--- End diff --
I don't think we should support a self-join of the same Dataset/DateFrame
of the same name. That is,
`df.join(df)`
should be blocked. We can ask the user to express it as
`df.join(df.as("df2"))`
, which is clearer. We certainly must not support
`df.join(df, df("col1") === df("col2")`
, which blindly put `"col1"` and `"col2"` to the first `df`. @sarutak 's
solution does change the behaviour to an error.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]