You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Alexey Dmitriev (Jira)" <ji...@apache.org> on 2023/10/30 10:24:00 UTC
[jira] [Commented] (SPARK-45722) False positive when cheking for ambigious columns
[ https://issues.apache.org/jira/browse/SPARK-45722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17780942#comment-17780942 ]
Alexey Dmitriev commented on SPARK-45722:
-----------------------------------------
I think the type of the merge should be checked [here|https://github.com/apache/spark/blob/b92265a98f241b333467a02f4fffc9889ad3e7da/sql/core/src/main/scala/org/apache/spark/sql/execution/analysis/DetectAmbiguousSelfJoin.scala#L129]
> False positive when cheking for ambigious columns
> --------------------------------------------------
>
> Key: SPARK-45722
> URL: https://issues.apache.org/jira/browse/SPARK-45722
> Project: Spark
> Issue Type: Bug
> Components: PySpark
> Affects Versions: 3.4.0
> Environment: py3.11
> pyspark 3.4.0
> Reporter: Alexey Dmitriev
> Priority: Major
>
> I have following code, which I expect to work
> ```
> from pyspark.sql import SparkSession
> session = SparkSession.Builder().getOrCreate()
> A = session.createDataFrame([(1,)], ['a'])
> B = session.createDataFrame([(1,)], ['b'])
> A.join(B).select(B.b) # works fine
> C = A.join(A.join(B), on=F.lit(False), how='leftanti') # C has the same columns as A (columns, not only names)
> C.join(B).select(B.b) #doesn't work, says B.b is ambigious,
> ```
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org