You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (JIRA)" <ji...@apache.org> on 2016/07/20 17:55:20 UTC

[jira] [Comment Edited] (SPARK-16651) No exception using DataFrame.withColumnRenamed when existing column doesn't exist

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

Dongjoon Hyun edited comment on SPARK-16651 at 7/20/16 5:55 PM:
----------------------------------------------------------------

Also, in Spark 2.0 RC5, DataFrame is merged into Dataset and the documentation of Dataset still has that notice.

{code}
def withColumnRenamed(existingName: String, newName: String): DataFrame
Returns a new Dataset with a column renamed. This is a no-op if schema doesn't contain existingName.
Since 2.0.0
{code}

http://people.apache.org/~pwendell/spark-releases/spark-2.0.0-rc5-docs/api/scala/index.html#org.apache.spark.sql.Dataset


was (Author: dongjoon):
Also, in Spark 2.0 RC, Dataframe is merged into Dataset and the documentation of Dataset still has that notice.

{code}
def withColumnRenamed(existingName: String, newName: String): DataFrame
Returns a new Dataset with a column renamed. This is a no-op if schema doesn't contain existingName.
Since 2.0.0
{code}

http://people.apache.org/~pwendell/spark-releases/spark-2.0.0-rc5-docs/api/scala/index.html#org.apache.spark.sql.Dataset

> No exception using DataFrame.withColumnRenamed when existing column doesn't exist
> ---------------------------------------------------------------------------------
>
>                 Key: SPARK-16651
>                 URL: https://issues.apache.org/jira/browse/SPARK-16651
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 1.5.0
>            Reporter: Tom Phillips
>
> The {{withColumnRenamed}} method does not raise an exception when the existing column does not exist in the dataframe.
> Example:
> {code}
> In [4]: df.show()
> +---+-----+
> |age| name|
> +---+-----+
> |  1|Alice|
> +---+-----+
> In [5]: df = df.withColumnRenamed('dob', 'date_of_birth')
> In [6]: df.show()
> +---+-----+
> |age| name|
> +---+-----+
> |  1|Alice|
> +---+-----+
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org