spark-instrumented-optimizer/R/pkg
hyukjinkwon 07fd68a29f [SPARK-21897][PYTHON][R] Add unionByName API to DataFrame in Python and R
## What changes were proposed in this pull request?

This PR proposes to add a wrapper for `unionByName` API to R and Python as well.

**Python**

```python
df1 = spark.createDataFrame([[1, 2, 3]], ["col0", "col1", "col2"])
df2 = spark.createDataFrame([[4, 5, 6]], ["col1", "col2", "col0"])
df1.unionByName(df2).show()
```

```
+----+----+----+
|col0|col1|col3|
+----+----+----+
|   1|   2|   3|
|   6|   4|   5|
+----+----+----+
```

**R**

```R
df1 <- select(createDataFrame(mtcars), "carb", "am", "gear")
df2 <- select(createDataFrame(mtcars), "am", "gear", "carb")
head(unionByName(limit(df1, 2), limit(df2, 2)))
```

```
  carb am gear
1    4  1    4
2    4  1    4
3    4  1    4
4    4  1    4
```

## How was this patch tested?

Doctests for Python and unit test added in `test_sparkSQL.R` for R.

Author: hyukjinkwon <gurwls223@gmail.com>

Closes #19105 from HyukjinKwon/unionByName-r-python.
2017-09-03 21:03:21 +09:00
..
inst [SPARK-21093][R] Terminate R's worker processes in the parent of R's daemon to prevent a leak 2017-07-08 14:24:37 -07:00
R [SPARK-21897][PYTHON][R] Add unionByName API to DataFrame in Python and R 2017-09-03 21:03:21 +09:00
src-native [SPARK-6811] Copy SparkR lib in make-distribution.sh 2015-05-23 00:04:01 -07:00
tests [SPARK-21897][PYTHON][R] Add unionByName API to DataFrame in Python and R 2017-09-03 21:03:21 +09:00
vignettes [SPARK-21805][SPARKR] Disable R vignettes code on Windows 2017-08-23 21:35:17 -07:00
.lintr [SPARK-20278][R] Disable 'multiple_dots_linter' lint rule that is against project's code style 2017-04-16 11:27:27 -07:00
.Rbuildignore [SPARK-20877][SPARKR][FOLLOWUP] clean up after test move 2017-06-11 03:00:44 -07:00
DESCRIPTION [SPARK-21805][SPARKR] Disable R vignettes code on Windows 2017-08-23 21:35:17 -07:00
NAMESPACE [SPARK-21897][PYTHON][R] Add unionByName API to DataFrame in Python and R 2017-09-03 21:03:21 +09:00