Github user actuaryzhang commented on a diff in the pull request:
https://github.com/apache/spark/pull/17159#discussion_r104335939
--- Diff: R/pkg/R/DataFrame.R ---
@@ -2685,7 +2686,8 @@ setMethod("unionAll",
#' Union two or more SparkDataFrames
#'
-#' Union two or more SparkDataFrames. This is equivalent to \code{UNION
ALL} in SQL.
+#' Union two or more SparkDataFrames by row. In constrast to \link{union},
this method
+#' requires that the input SparkDataFrames have the same column names.
--- End diff --
Thanks. Updated doc. R's `rbind` seems to do type conversion similarly to
`union`:
```
df <- data.frame(name = c("Michael", "Andy", "Justin"), age = c(1, 30, 19))
df2 <- df
df2$age <- as.character(df2$age)
rbind(df, df2)
name age
1 Michael 1
2 Andy 30
3 Justin 19
4 Michael 1
5 Andy 30
6 Justin 19
str(rbind(df, df2))
'data.frame': 6 obs. of 2 variables:
$ name: Factor w/ 3 levels "Andy","Justin",..: 3 1 2 3 1 2
$ age : chr "1" "30" "19" "1" ...
```
---
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]