Skip to content

Commit

Permalink
Merge pull request apache#204 from palantir/rk/merge-upstream
Browse files Browse the repository at this point in the history
Upstream merge
  • Loading branch information
robert3005 authored Jun 13, 2017
2 parents 9bac766 + 22b56ab commit 5ba77a1
Show file tree
Hide file tree
Showing 481 changed files with 14,435 additions and 4,419 deletions.
10 changes: 5 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
(Interpreter classes (all .scala files in repl/src/main/scala
except for Main.Scala, SparkHelper.scala and ExecutorClassLoader.scala),
and for SerializableMapWrapper in JavaUtils.scala)
(BSD-like) Scala Actors library (org.scala-lang:scala-actors:2.11.7 - http://www.scala-lang.org/)
(BSD-like) Scala Compiler (org.scala-lang:scala-compiler:2.11.7 - http://www.scala-lang.org/)
(BSD-like) Scala Compiler (org.scala-lang:scala-reflect:2.11.7 - http://www.scala-lang.org/)
(BSD-like) Scala Library (org.scala-lang:scala-library:2.11.7 - http://www.scala-lang.org/)
(BSD-like) Scalap (org.scala-lang:scalap:2.11.7 - http://www.scala-lang.org/)
(BSD-like) Scala Actors library (org.scala-lang:scala-actors:2.11.8 - http://www.scala-lang.org/)
(BSD-like) Scala Compiler (org.scala-lang:scala-compiler:2.11.8 - http://www.scala-lang.org/)
(BSD-like) Scala Compiler (org.scala-lang:scala-reflect:2.11.8 - http://www.scala-lang.org/)
(BSD-like) Scala Library (org.scala-lang:scala-library:2.11.8 - http://www.scala-lang.org/)
(BSD-like) Scalap (org.scala-lang:scalap:2.11.8 - http://www.scala-lang.org/)
(BSD-style) scalacheck (org.scalacheck:scalacheck_2.11:1.10.0 - http://www.scalacheck.org)
(BSD-style) spire (org.spire-math:spire_2.11:0.7.1 - http://spire-math.org)
(BSD-style) spire-macros (org.spire-math:spire-macros_2.11:0.7.1 - http://spire-math.org)
Expand Down
1 change: 1 addition & 0 deletions R/pkg/.Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
^README\.Rmd$
^src-native$
^html$
^tests/fulltests/*
5 changes: 5 additions & 0 deletions R/pkg/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ exportMethods("glm",
"spark.als",
"spark.kstest",
"spark.logit",
"spark.decisionTree",
"spark.randomForest",
"spark.gbt",
"spark.bisectingKmeans",
Expand Down Expand Up @@ -414,6 +415,8 @@ export("as.DataFrame",
"print.summary.GeneralizedLinearRegressionModel",
"read.ml",
"print.summary.KSTest",
"print.summary.DecisionTreeRegressionModel",
"print.summary.DecisionTreeClassificationModel",
"print.summary.RandomForestRegressionModel",
"print.summary.RandomForestClassificationModel",
"print.summary.GBTRegressionModel",
Expand Down Expand Up @@ -452,6 +455,8 @@ S3method(print, structField)
S3method(print, structType)
S3method(print, summary.GeneralizedLinearRegressionModel)
S3method(print, summary.KSTest)
S3method(print, summary.DecisionTreeRegressionModel)
S3method(print, summary.DecisionTreeClassificationModel)
S3method(print, summary.RandomForestRegressionModel)
S3method(print, summary.RandomForestClassificationModel)
S3method(print, summary.GBTRegressionModel)
Expand Down
23 changes: 13 additions & 10 deletions R/pkg/R/DataFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ setMethod("registerTempTable",
#' sparkR.session()
#' df <- read.df(path, "parquet")
#' df2 <- read.df(path2, "parquet")
#' createOrReplaceTempView(df, "table1")
#' saveAsTable(df, "table1")
#' insertInto(df2, "table1", overwrite = TRUE)
#'}
#' @note insertInto since 1.4.0
Expand Down Expand Up @@ -1125,7 +1125,8 @@ setMethod("dim",
#' path <- "path/to/file.json"
#' df <- read.json(path)
#' collected <- collect(df)
#' firstName <- collected[[1]]$name
#' class(collected)
#' firstName <- names(collected)[1]
#' }
#' @note collect since 1.4.0
setMethod("collect",
Expand Down Expand Up @@ -2645,6 +2646,7 @@ generateAliasesForIntersectedCols <- function (x, intersectedColNames, suffix) {
#' Input SparkDataFrames can have different schemas (names and data types).
#'
#' Note: This does not remove duplicate rows across the two SparkDataFrames.
#' Also as standard in SQL, this function resolves columns by position (not by name).
#'
#' @param x A SparkDataFrame
#' @param y A SparkDataFrame
Expand Down Expand Up @@ -2814,7 +2816,7 @@ setMethod("except",
#' path <- "path/to/file.json"
#' df <- read.json(path)
#' write.df(df, "myfile", "parquet", "overwrite")
#' saveDF(df, parquetPath2, "parquet", mode = saveMode, mergeSchema = mergeSchema)
#' saveDF(df, parquetPath2, "parquet", mode = "append", mergeSchema = TRUE)
#' }
#' @note write.df since 1.4.0
setMethod("write.df",
Expand Down Expand Up @@ -3097,8 +3099,8 @@ setMethod("fillna",
#' @family SparkDataFrame functions
#' @aliases as.data.frame,SparkDataFrame-method
#' @rdname as.data.frame
#' @examples \dontrun{
#'
#' @examples
#' \dontrun{
#' irisDF <- createDataFrame(iris)
#' df <- as.data.frame(irisDF[irisDF$Species == "setosa", ])
#' }
Expand Down Expand Up @@ -3175,7 +3177,8 @@ setMethod("with",
#' @aliases str,SparkDataFrame-method
#' @family SparkDataFrame functions
#' @param object a SparkDataFrame
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' # Create a SparkDataFrame from the Iris dataset
#' irisDF <- createDataFrame(iris)
#'
Expand Down Expand Up @@ -3667,8 +3670,8 @@ setMethod("checkpoint",
#' mean(cube(df, "cyl", "gear", "am"), "mpg")
#'
#' # Following calls are equivalent
#' agg(cube(carsDF), mean(carsDF$mpg))
#' agg(carsDF, mean(carsDF$mpg))
#' agg(cube(df), mean(df$mpg))
#' agg(df, mean(df$mpg))
#' }
#' @note cube since 2.3.0
#' @seealso \link{agg}, \link{groupBy}, \link{rollup}
Expand Down Expand Up @@ -3702,8 +3705,8 @@ setMethod("cube",
#' mean(rollup(df, "cyl", "gear", "am"), "mpg")
#'
#' # Following calls are equivalent
#' agg(rollup(carsDF), mean(carsDF$mpg))
#' agg(carsDF, mean(carsDF$mpg))
#' agg(rollup(df), mean(df$mpg))
#' agg(df, mean(df$mpg))
#' }
#' @note rollup since 2.3.0
#' @seealso \link{agg}, \link{cube}, \link{groupBy}
Expand Down
3 changes: 2 additions & 1 deletion R/pkg/R/WindowSpec.R
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ setMethod("rangeBetween",
#' @aliases over,Column,WindowSpec-method
#' @family colum_func
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#'
#' # Partition by am (transmission) and order by hp (horsepower)
Expand Down
6 changes: 4 additions & 2 deletions R/pkg/R/column.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ createMethods()
#' @aliases alias,Column-method
#' @family colum_func
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(iris)
#'
#' head(select(
Expand Down Expand Up @@ -244,7 +245,8 @@ setMethod("between", signature(x = "Column"),
#' @family colum_func
#' @aliases cast,Column-method
#'
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' cast(df$age, "string")
#' }
#' @note cast since 1.4.0
Expand Down
51 changes: 34 additions & 17 deletions R/pkg/R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -3257,7 +3257,8 @@ setMethod("when", signature(condition = "Column", value = "ANY"),
#' @aliases ifelse,Column-method
#' @seealso \link{when}
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' ifelse(df$a > 1 & df$b > 2, 0, 1)
#' ifelse(df$a > 1, df$a, 1)
#' }
Expand Down Expand Up @@ -3292,7 +3293,8 @@ setMethod("ifelse",
#' @family window functions
#' @aliases cume_dist,missing-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#' ws <- orderBy(windowPartitionBy("am"), "hp")
#' out <- select(df, over(cume_dist(), ws), df$hp, df$am)
Expand Down Expand Up @@ -3321,7 +3323,8 @@ setMethod("cume_dist",
#' @family window functions
#' @aliases dense_rank,missing-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#' ws <- orderBy(windowPartitionBy("am"), "hp")
#' out <- select(df, over(dense_rank(), ws), df$hp, df$am)
Expand Down Expand Up @@ -3352,7 +3355,8 @@ setMethod("dense_rank",
#' @aliases lag,characterOrColumn-method
#' @family window functions
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#'
#' # Partition by am (transmission) and order by hp (horsepower)
Expand Down Expand Up @@ -3395,7 +3399,8 @@ setMethod("lag",
#' @family window functions
#' @aliases lead,characterOrColumn,numeric-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#'
#' # Partition by am (transmission) and order by hp (horsepower)
Expand Down Expand Up @@ -3434,7 +3439,8 @@ setMethod("lead",
#' @aliases ntile,numeric-method
#' @family window functions
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#'
#' # Partition by am (transmission) and order by hp (horsepower)
Expand Down Expand Up @@ -3466,7 +3472,8 @@ setMethod("ntile",
#' @family window functions
#' @aliases percent_rank,missing-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#' ws <- orderBy(windowPartitionBy("am"), "hp")
#' out <- select(df, over(percent_rank(), ws), df$hp, df$am)
Expand Down Expand Up @@ -3496,7 +3503,8 @@ setMethod("percent_rank",
#' @family window functions
#' @aliases rank,missing-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#' ws <- orderBy(windowPartitionBy("am"), "hp")
#' out <- select(df, over(rank(), ws), df$hp, df$am)
Expand Down Expand Up @@ -3533,7 +3541,8 @@ setMethod("rank",
#' @aliases row_number,missing-method
#' @family window functions
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#' ws <- orderBy(windowPartitionBy("am"), "hp")
#' out <- select(df, over(row_number(), ws), df$hp, df$am)
Expand Down Expand Up @@ -3761,7 +3770,8 @@ setMethod("collect_set",
#' @family string functions
#' @aliases split_string,Column-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- read.text("README.md")
#'
#' head(select(df, split_string(df$value, "\\s+")))
Expand Down Expand Up @@ -3790,7 +3800,8 @@ setMethod("split_string",
#' @family string functions
#' @aliases repeat_string,Column-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- read.text("README.md")
#'
#' first(select(df, repeat_string(df$value, 3)))
Expand Down Expand Up @@ -3819,7 +3830,8 @@ setMethod("repeat_string",
#' @family collection functions
#' @aliases explode_outer,Column-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(data.frame(
#' id = c(1, 2, 3), text = c("a,b,c", NA, "d,e")
#' ))
Expand Down Expand Up @@ -3847,7 +3859,8 @@ setMethod("explode_outer",
#' @family collection functions
#' @aliases posexplode_outer,Column-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(data.frame(
#' id = c(1, 2, 3), text = c("a,b,c", NA, "d,e")
#' ))
Expand Down Expand Up @@ -3875,7 +3888,8 @@ setMethod("posexplode_outer",
#' @aliases not,Column-method
#' @family non-aggregate functions
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(data.frame(
#' is_true = c(TRUE, FALSE, NA),
#' flag = c(1, 0, 1)
Expand Down Expand Up @@ -3908,7 +3922,8 @@ setMethod("not",
#' @family aggregate functions
#' @aliases grouping_bit,Column-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#'
#' # With cube
Expand Down Expand Up @@ -3949,7 +3964,8 @@ setMethod("grouping_bit",
#' @family aggregate functions
#' @aliases grouping_id,Column-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- createDataFrame(mtcars)
#'
#' # With cube
Expand Down Expand Up @@ -3987,7 +4003,8 @@ setMethod("grouping_id",
#' @family non-aggregate functions
#' @aliases input_file_name,missing-method
#' @export
#' @examples \dontrun{
#' @examples
#' \dontrun{
#' df <- read.text("README.md")
#'
#' head(select(df, input_file_name()))
Expand Down
5 changes: 5 additions & 0 deletions R/pkg/R/generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,11 @@ setGeneric("spark.mlp", function(data, formula, ...) { standardGeneric("spark.ml
#' @export
setGeneric("spark.naiveBayes", function(data, formula, ...) { standardGeneric("spark.naiveBayes") })

#' @rdname spark.decisionTree
#' @export
setGeneric("spark.decisionTree",
function(data, formula, ...) { standardGeneric("spark.decisionTree") })

#' @rdname spark.randomForest
#' @export
setGeneric("spark.randomForest",
Expand Down
2 changes: 1 addition & 1 deletion R/pkg/R/install.R
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ hadoopVersionName <- function(hadoopVersion) {
# The implementation refers to appdirs package: https://pypi.python.org/pypi/appdirs and
# adapt to Spark context
sparkCachePath <- function() {
if (.Platform$OS.type == "windows") {
if (is_windows()) {
winAppPath <- Sys.getenv("LOCALAPPDATA", unset = NA)
if (is.na(winAppPath)) {
stop(paste("%LOCALAPPDATA% not found.",
Expand Down
Loading

0 comments on commit 5ba77a1

Please sign in to comment.