GitHub user actuaryzhang opened a pull request:
https://github.com/apache/spark/pull/17105
[SPARK-19773][SparkR] SparkDataFrame should not allow duplicate names
## What changes were proposed in this pull request?
SparkDataFrame in SparkR seems to accept duplicate names at creation, but
incurs error when calling methods downstream. For example, we can do:
```
l <- list(list(1, 2), list(3, 4))
df <- createDataFrame(l, c("a", "a"))
head(df)
```
But an error occurs when we do `df$a = df$a * 2.0`.
In this PR, I add validity check for duplicate names at initialization.
## How was this patch tested?
new tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/actuaryzhang/spark sparkRDataFrameValid
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/17105.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #17105
----
commit f0f2dbb0cdcb1ba5f43a517b802b1a75f4f6563c
Author: actuaryzhang <[email protected]>
Date: 2017-02-28T19:25:55Z
add dataframe validity check
commit 21b8b4d87b67832b51fffaa0b84b3a05f5f66dcc
Author: actuaryzhang <[email protected]>
Date: 2017-02-28T20:36:05Z
add tests
----
---
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]