Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-6635][SQL] DataFrame.withColumn should replace columns with identical column names #5541

Closed
wants to merge 2 commits into from

Conversation

viirya
Copy link
Member

@viirya viirya commented Apr 16, 2015

@SparkQA
Copy link

SparkQA commented Apr 16, 2015

Test build #30413 has finished for PR 5541 at commit 72f35b1.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.


val df2 = TestSQLContext.sparkContext.parallelize(Array(1, 2, 3)).toDF("x")
val df3 = df2.withColumn("x", df2("x") + 1)
assert(df3.select("x").collect().toSeq === Seq(Row(2), Row(3), Row(4)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this its own test and use checkAnswer to check the result.

@SparkQA
Copy link

SparkQA commented Apr 17, 2015

Test build #30469 has finished for PR 5541 at commit b539c7b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.
  • This patch does not change any dependencies.

@asfgit asfgit closed this in c736220 Apr 21, 2015
@marmbrus
Copy link
Contributor

Thanks! Merged to master.

@bplaster
Copy link

@marmbrus
Copy link
Contributor

Pull requests to improve documentation are always welcome :)

nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
…entical column names

JIRA https://issues.apache.org/jira/browse/SPARK-6635

Author: Liang-Chi Hsieh <[email protected]>

Closes apache#5541 from viirya/replace_with_column and squashes the following commits:

b539c7b [Liang-Chi Hsieh] For comment.
72f35b1 [Liang-Chi Hsieh] DataFrame.withColumn can replace original column with identical column name.
@viirya viirya deleted the replace_with_column branch December 27, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants