GitHub user rxin opened a pull request:
https://github.com/apache/spark/pull/6072
[SPARK-7321][SQL] Add Column expression for conditional statements
(when/otherwise)
This builds on https://github.com/apache/spark/pull/5932 and should close
https://github.com/apache/spark/pull/5932 as well.
As an example:
```python
df.select(when(df['age'] == 2, 3).otherwise(4).alias("age")).collect()
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rxin/spark when-expr
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/6072.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 #6072
----
commit 76d63461d2c512f5a6519d25dcaa14cfa8ec6468
Author: kaka1992 <[email protected]>
Date: 2015-05-06T03:20:01Z
[SPARK-7321][SQL] Add Column expression for conditional statements (if,
case)
commit 801009e798dc3c82f549241e2764e300ad1295da
Author: kaka1992 <[email protected]>
Date: 2015-05-06T14:55:29Z
Update
commit 8218d0acc287565a62259691803fd13c84f651ba
Author: kaka1992 <[email protected]>
Date: 2015-05-12T02:28:49Z
Update
commit 95724c6375e3f0fda4bef4f2d8c6a62811a196cc
Author: kaka1992 <[email protected]>
Date: 2015-05-12T02:38:21Z
Update
commit 762f6a5aba1fd0f0110e5e6e674751d98fbb5c6a
Author: Reynold Xin <[email protected]>
Date: 2015-05-12T04:02:40Z
Merge pull request #5932 from kaka1992/IFCASE
[SPARK-7321][SQL] Add Column expression for conditional statements
commit bfb9d9fcececbc682f2c5bb2c0586e56ea499adf
Author: Reynold Xin <[email protected]>
Date: 2015-05-12T05:24:43Z
Updated documentation and test cases.
----
---
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]