You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2023/02/14 10:43:00 UTC

[jira] [Commented] (SPARK-42367) DataFrame.drop should handle duplicated columns properly

    [ https://issues.apache.org/jira/browse/SPARK-42367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17688434#comment-17688434 ] 

Apache Spark commented on SPARK-42367:
--------------------------------------

User 'zhengruifeng' has created a pull request for this issue:
https://github.com/apache/spark/pull/40013

> DataFrame.drop should handle duplicated columns properly
> --------------------------------------------------------
>
>                 Key: SPARK-42367
>                 URL: https://issues.apache.org/jira/browse/SPARK-42367
>             Project: Spark
>          Issue Type: Sub-task
>          Components: Connect, PySpark
>    Affects Versions: 3.4.0
>            Reporter: Ruifeng Zheng
>            Priority: Major
>
> {code:java}
> >>> df.join(df2, df.name == df2.name, 'inner').show()
> +---+----+------+----+
> |age|name|height|name|
> +---+----+------+----+
> | 16| Bob|    85| Bob|
> | 14| Tom|    80| Tom|
> +---+----+------+----+
> >>> df.join(df2, df.name == df2.name, 'inner').drop('name').show()
> +---+------+
> |age|height|
> +---+------+
> | 16|    85|
> | 14|    80|
> +---+------+
> {code}



--
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