Skip to content

Commit f7d9e54

Browse files
committed
Merge remote-tracking branch 'apache/master' into UDAF
2 parents 39ee975 + b7bcbe2 commit f7d9e54

File tree

500 files changed

+14161
-6972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

500 files changed

+14161
-6972
lines changed

.rat-excludes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,5 @@ help/*
9191
html/*
9292
INDEX
9393
.lintr
94+
gen-java.*
95+
.*avpr

R/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SparkR is an R package that provides a light-weight frontend to use Spark from R
66

77
#### Build Spark
88

9-
Build Spark with [Maven](http://spark.apache.org/docs/latest/building-spark.html#building-with-buildmvn) and include the `-PsparkR` profile to build the R package. For example to use the default Hadoop versions you can run
9+
Build Spark with [Maven](http://spark.apache.org/docs/latest/building-spark.html#building-with-buildmvn) and include the `-Psparkr` profile to build the R package. For example to use the default Hadoop versions you can run
1010
```
1111
build/mvn -DskipTests -Psparkr package
1212
```

R/install-dev.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ set SPARK_HOME=%~dp0..
2525
MKDIR %SPARK_HOME%\R\lib
2626

2727
R.exe CMD INSTALL --library="%SPARK_HOME%\R\lib" %SPARK_HOME%\R\pkg\
28+
29+
rem Zip the SparkR package so that it can be distributed to worker nodes on YARN
30+
pushd %SPARK_HOME%\R\lib
31+
%JAVA_HOME%\bin\jar.exe cfM "%SPARK_HOME%\R\lib\sparkr.zip" SparkR
32+
popd

R/install-dev.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,16 @@ LIB_DIR="$FWDIR/lib"
3434

3535
mkdir -p $LIB_DIR
3636

37-
pushd $FWDIR
37+
pushd $FWDIR > /dev/null
3838

3939
# Generate Rd files if devtools is installed
4040
Rscript -e ' if("devtools" %in% rownames(installed.packages())) { library(devtools); devtools::document(pkg="./pkg", roclets=c("rd")) }'
4141

4242
# Install SparkR to $LIB_DIR
4343
R CMD INSTALL --library=$LIB_DIR $FWDIR/pkg/
4444

45-
popd
45+
# Zip the SparkR package so that it can be distributed to worker nodes on YARN
46+
cd $LIB_DIR
47+
jar cfM "$LIB_DIR/sparkr.zip" SparkR
48+
49+
popd > /dev/null

R/pkg/DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ Collate:
3232
'serialize.R'
3333
'sparkR.R'
3434
'utils.R'
35-
'zzz.R'

R/pkg/R/RDD.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ setMethod("getJRDD", signature(rdd = "PipelinedRDD"),
165165
serializedFuncArr,
166166
rdd@env$prev_serializedMode,
167167
packageNamesArr,
168-
as.character(.sparkREnv[["libname"]]),
169168
broadcastArr,
170169
callJMethod(prev_jrdd, "classTag"))
171170
} else {
@@ -175,7 +174,6 @@ setMethod("getJRDD", signature(rdd = "PipelinedRDD"),
175174
rdd@env$prev_serializedMode,
176175
serializedMode,
177176
packageNamesArr,
178-
as.character(.sparkREnv[["libname"]]),
179177
broadcastArr,
180178
callJMethod(prev_jrdd, "classTag"))
181179
}

R/pkg/R/SQLContext.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ infer_type <- function(x) {
8686
createDataFrame <- function(sqlContext, data, schema = NULL, samplingRatio = 1.0) {
8787
if (is.data.frame(data)) {
8888
# get the names of columns, they will be put into RDD
89-
schema <- names(data)
89+
if (is.null(schema)) {
90+
schema <- names(data)
91+
}
9092
n <- nrow(data)
9193
m <- ncol(data)
9294
# get rid of factor type

R/pkg/R/pairRDD.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ setMethod("partitionBy",
215215
serializedHashFuncBytes,
216216
getSerializedMode(x),
217217
packageNamesArr,
218-
as.character(.sparkREnv$libname),
219218
broadcastArr,
220219
callJMethod(jrdd, "classTag"))
221220

R/pkg/R/sparkR.R

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717

1818
.sparkREnv <- new.env()
1919

20-
sparkR.onLoad <- function(libname, pkgname) {
21-
.sparkREnv$libname <- libname
22-
}
23-
2420
# Utility function that returns TRUE if we have an active connection to the
2521
# backend and FALSE otherwise
2622
connExists <- function(env) {
@@ -80,7 +76,6 @@ sparkR.stop <- function() {
8076
#' @param sparkEnvir Named list of environment variables to set on worker nodes.
8177
#' @param sparkExecutorEnv Named list of environment variables to be used when launching executors.
8278
#' @param sparkJars Character string vector of jar files to pass to the worker nodes.
83-
#' @param sparkRLibDir The path where R is installed on the worker nodes.
8479
#' @param sparkPackages Character string vector of packages from spark-packages.org
8580
#' @export
8681
#' @examples
@@ -101,7 +96,6 @@ sparkR.init <- function(
10196
sparkEnvir = list(),
10297
sparkExecutorEnv = list(),
10398
sparkJars = "",
104-
sparkRLibDir = "",
10599
sparkPackages = "") {
106100

107101
if (exists(".sparkRjsc", envir = .sparkREnv)) {
@@ -170,10 +164,6 @@ sparkR.init <- function(
170164
sparkHome <- normalizePath(sparkHome)
171165
}
172166

173-
if (nchar(sparkRLibDir) != 0) {
174-
.sparkREnv$libname <- sparkRLibDir
175-
}
176-
177167
sparkEnvirMap <- new.env()
178168
for (varname in names(sparkEnvir)) {
179169
sparkEnvirMap[[varname]] <- sparkEnvir[[varname]]

R/pkg/inst/profile/general.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
.First <- function() {
19-
home <- Sys.getenv("SPARK_HOME")
20-
.libPaths(c(file.path(home, "R", "lib"), .libPaths()))
19+
packageDir <- Sys.getenv("SPARKR_PACKAGE_DIR")
20+
.libPaths(c(packageDir, .libPaths()))
2121
Sys.setenv(NOAWT=1)
2222
}

0 commit comments

Comments
 (0)