diff options
author | hyukjinkwon <gurwls223@gmail.com> | 2017-03-14 19:51:25 -0700 |
---|---|---|
committer | Felix Cheung <felixcheung@apache.org> | 2017-03-14 19:51:25 -0700 |
commit | d1f6c64c4b763c05d6d79ae5497f298dc3835f3e (patch) | |
tree | 3212b7cef66bde23763bba7358f7560a973d8beb /sql/hive | |
parent | 8fb2a02e2ce6832e3d9338a7d0148dfac9fa24c2 (diff) | |
download | spark-d1f6c64c4b763c05d6d79ae5497f298dc3835f3e.tar.gz spark-d1f6c64c4b763c05d6d79ae5497f298dc3835f3e.tar.bz2 spark-d1f6c64c4b763c05d6d79ae5497f298dc3835f3e.zip |
[SPARK-19828][R] Support array type in from_json in R
## What changes were proposed in this pull request?
Since we could not directly define the array type in R, this PR proposes to support array types in R as string types that are used in `structField` as below:
```R
jsonArr <- "[{\"name\":\"Bob\"}, {\"name\":\"Alice\"}]"
df <- as.DataFrame(list(list("people" = jsonArr)))
collect(select(df, alias(from_json(df$people, "array<struct<name:string>>"), "arrcol")))
```
prints
```R
arrcol
1 Bob, Alice
```
## How was this patch tested?
Unit tests in `test_sparkSQL.R`.
Author: hyukjinkwon <gurwls223@gmail.com>
Closes #17178 from HyukjinKwon/SPARK-19828.
Diffstat (limited to 'sql/hive')
0 files changed, 0 insertions, 0 deletions