diff options
author | Reynold Xin <rxin@databricks.com> | 2015-05-12 21:43:34 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-05-12 21:44:16 -0700 |
commit | 219a9043ef59d11e1dd58f607022558559508f6b (patch) | |
tree | 1e47238cfe7bad3025f0987631db87b2a91158a3 /sql/hive | |
parent | bdd5db9f16bc5fc18357b504781cf76774f9acd6 (diff) | |
download | spark-219a9043ef59d11e1dd58f607022558559508f6b.tar.gz spark-219a9043ef59d11e1dd58f607022558559508f6b.tar.bz2 spark-219a9043ef59d11e1dd58f607022558559508f6b.zip |
[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()
```
Author: Reynold Xin <rxin@databricks.com>
Author: kaka1992 <kaka_1992@163.com>
Closes #6072 from rxin/when-expr and squashes the following commits:
8f49201 [Reynold Xin] Throw exception if otherwise is applied twice.
0455eda [Reynold Xin] Reset run-tests.
bfb9d9f [Reynold Xin] Updated documentation and test cases.
762f6a5 [Reynold Xin] Merge pull request #5932 from kaka1992/IFCASE
95724c6 [kaka1992] Update
8218d0a [kaka1992] Update
801009e [kaka1992] Update
76d6346 [kaka1992] [SPARK-7321][SQL] Add Column expression for conditional statements (if, case)
(cherry picked from commit 97dee313f23b00f15638cb72a4a80c1f197f8a9d)
Signed-off-by: Reynold Xin <rxin@databricks.com>
Diffstat (limited to 'sql/hive')
0 files changed, 0 insertions, 0 deletions