Skip to content

Commit 766a033

Browse files
authored
Merge branch 'master' into SPARK-13947-error-message
2 parents 4ac8143 + ef3df91 commit 766a033

File tree

869 files changed

+22593
-7991
lines changed

Some content is hidden

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

869 files changed

+22593
-7991
lines changed

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,4 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
297297
(MIT License) RowsGroup (http://datatables.net/license/mit)
298298
(MIT License) jsonFormatter (http://www.jqueryscript.net/other/jQuery-Plugin-For-Pretty-JSON-Formatting-jsonFormatter.html)
299299
(MIT License) modernizr (https://github.com/Modernizr/Modernizr/blob/master/LICENSE)
300+
(MIT License) machinist (https://github.com/typelevel/machinist)

R/check-cran.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
set -o pipefail
2121
set -e
2222

23-
FWDIR="$(cd `dirname "${BASH_SOURCE[0]}"`; pwd)"
24-
pushd $FWDIR > /dev/null
23+
FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)"
24+
pushd "$FWDIR" > /dev/null
2525

26-
. $FWDIR/find-r.sh
26+
. "$FWDIR/find-r.sh"
2727

2828
# Install the package (this is required for code in vignettes to run when building it later)
2929
# Build the latest docs, but not vignettes, which is built with the package next
30-
. $FWDIR/install-dev.sh
30+
. "$FWDIR/install-dev.sh"
3131

3232
# Build source package with vignettes
3333
SPARK_HOME="$(cd "${FWDIR}"/..; pwd)"
34-
. "${SPARK_HOME}"/bin/load-spark-env.sh
34+
. "${SPARK_HOME}/bin/load-spark-env.sh"
3535
if [ -f "${SPARK_HOME}/RELEASE" ]; then
3636
SPARK_JARS_DIR="${SPARK_HOME}/jars"
3737
else
@@ -40,16 +40,16 @@ fi
4040

4141
if [ -d "$SPARK_JARS_DIR" ]; then
4242
# Build a zip file containing the source package with vignettes
43-
SPARK_HOME="${SPARK_HOME}" "$R_SCRIPT_PATH/"R CMD build $FWDIR/pkg
43+
SPARK_HOME="${SPARK_HOME}" "$R_SCRIPT_PATH/R" CMD build "$FWDIR/pkg"
4444

4545
find pkg/vignettes/. -not -name '.' -not -name '*.Rmd' -not -name '*.md' -not -name '*.pdf' -not -name '*.html' -delete
4646
else
47-
echo "Error Spark JARs not found in $SPARK_HOME"
47+
echo "Error Spark JARs not found in '$SPARK_HOME'"
4848
exit 1
4949
fi
5050

5151
# Run check as-cran.
52-
VERSION=`grep Version $FWDIR/pkg/DESCRIPTION | awk '{print $NF}'`
52+
VERSION=`grep Version "$FWDIR/pkg/DESCRIPTION" | awk '{print $NF}'`
5353

5454
CRAN_CHECK_OPTIONS="--as-cran"
5555

@@ -67,10 +67,10 @@ echo "Running CRAN check with $CRAN_CHECK_OPTIONS options"
6767

6868
if [ -n "$NO_TESTS" ] && [ -n "$NO_MANUAL" ]
6969
then
70-
"$R_SCRIPT_PATH/"R CMD check $CRAN_CHECK_OPTIONS SparkR_"$VERSION".tar.gz
70+
"$R_SCRIPT_PATH/R" CMD check $CRAN_CHECK_OPTIONS "SparkR_$VERSION.tar.gz"
7171
else
7272
# This will run tests and/or build vignettes, and require SPARK_HOME
73-
SPARK_HOME="${SPARK_HOME}" "$R_SCRIPT_PATH/"R CMD check $CRAN_CHECK_OPTIONS SparkR_"$VERSION".tar.gz
73+
SPARK_HOME="${SPARK_HOME}" "$R_SCRIPT_PATH/R" CMD check $CRAN_CHECK_OPTIONS "SparkR_$VERSION.tar.gz"
7474
fi
7575

7676
popd > /dev/null

R/create-docs.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@ export FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)"
3333
export SPARK_HOME="$(cd "`dirname "${BASH_SOURCE[0]}"`"/..; pwd)"
3434

3535
# Required for setting SPARK_SCALA_VERSION
36-
. "${SPARK_HOME}"/bin/load-spark-env.sh
36+
. "${SPARK_HOME}/bin/load-spark-env.sh"
3737

3838
echo "Using Scala $SPARK_SCALA_VERSION"
3939

40-
pushd $FWDIR > /dev/null
41-
. $FWDIR/find-r.sh
40+
pushd "$FWDIR" > /dev/null
41+
. "$FWDIR/find-r.sh"
4242

4343
# Install the package (this will also generate the Rd files)
44-
. $FWDIR/install-dev.sh
44+
. "$FWDIR/install-dev.sh"
4545

4646
# Now create HTML files
4747

4848
# knit_rd puts html in current working directory
4949
mkdir -p pkg/html
5050
pushd pkg/html
5151

52-
"$R_SCRIPT_PATH/"Rscript -e 'libDir <- "../../lib"; library(SparkR, lib.loc=libDir); library(knitr); knit_rd("SparkR", links = tools::findHTMLlinks(paste(libDir, "SparkR", sep="/")))'
52+
"$R_SCRIPT_PATH/Rscript" -e 'libDir <- "../../lib"; library(SparkR, lib.loc=libDir); library(knitr); knit_rd("SparkR", links = tools::findHTMLlinks(paste(libDir, "SparkR", sep="/")))'
5353

5454
popd
5555

R/create-rd.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
set -o pipefail
3030
set -e
3131

32-
FWDIR="$(cd `dirname "${BASH_SOURCE[0]}"`; pwd)"
33-
pushd $FWDIR > /dev/null
34-
. $FWDIR/find-r.sh
32+
FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)"
33+
pushd "$FWDIR" > /dev/null
34+
. "$FWDIR/find-r.sh"
3535

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

R/install-dev.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@
2929
set -o pipefail
3030
set -e
3131

32-
FWDIR="$(cd `dirname "${BASH_SOURCE[0]}"`; pwd)"
32+
FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)"
3333
LIB_DIR="$FWDIR/lib"
3434

35-
mkdir -p $LIB_DIR
35+
mkdir -p "$LIB_DIR"
3636

37-
pushd $FWDIR > /dev/null
38-
. $FWDIR/find-r.sh
37+
pushd "$FWDIR" > /dev/null
38+
. "$FWDIR/find-r.sh"
3939

40-
. $FWDIR/create-rd.sh
40+
. "$FWDIR/create-rd.sh"
4141

4242
# Install SparkR to $LIB_DIR
43-
"$R_SCRIPT_PATH/"R CMD INSTALL --library=$LIB_DIR $FWDIR/pkg/
43+
"$R_SCRIPT_PATH/R" CMD INSTALL --library="$LIB_DIR" "$FWDIR/pkg/"
4444

4545
# Zip the SparkR package so that it can be distributed to worker nodes on YARN
46-
cd $LIB_DIR
46+
cd "$LIB_DIR"
4747
jar cfM "$LIB_DIR/sparkr.zip" SparkR
4848

4949
popd > /dev/null

R/install-source-package.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,28 @@
2929
set -o pipefail
3030
set -e
3131

32-
FWDIR="$(cd `dirname "${BASH_SOURCE[0]}"`; pwd)"
33-
pushd $FWDIR > /dev/null
34-
. $FWDIR/find-r.sh
32+
FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)"
33+
pushd "$FWDIR" > /dev/null
34+
. "$FWDIR/find-r.sh"
3535

3636
if [ -z "$VERSION" ]; then
37-
VERSION=`grep Version $FWDIR/pkg/DESCRIPTION | awk '{print $NF}'`
37+
VERSION=`grep Version "$FWDIR/pkg/DESCRIPTION" | awk '{print $NF}'`
3838
fi
3939

40-
if [ ! -f "$FWDIR"/SparkR_"$VERSION".tar.gz ]; then
41-
echo -e "R source package file $FWDIR/SparkR_$VERSION.tar.gz is not found."
40+
if [ ! -f "$FWDIR/SparkR_$VERSION.tar.gz" ]; then
41+
echo -e "R source package file '$FWDIR/SparkR_$VERSION.tar.gz' is not found."
4242
echo -e "Please build R source package with check-cran.sh"
4343
exit -1;
4444
fi
4545

4646
echo "Removing lib path and installing from source package"
4747
LIB_DIR="$FWDIR/lib"
48-
rm -rf $LIB_DIR
49-
mkdir -p $LIB_DIR
50-
"$R_SCRIPT_PATH/"R CMD INSTALL SparkR_"$VERSION".tar.gz --library=$LIB_DIR
48+
rm -rf "$LIB_DIR"
49+
mkdir -p "$LIB_DIR"
50+
"$R_SCRIPT_PATH/R" CMD INSTALL "SparkR_$VERSION.tar.gz" --library="$LIB_DIR"
5151

5252
# Zip the SparkR package so that it can be distributed to worker nodes on YARN
53-
pushd $LIB_DIR > /dev/null
53+
pushd "$LIB_DIR" > /dev/null
5454
jar cfM "$LIB_DIR/sparkr.zip" SparkR
5555
popd > /dev/null
5656

R/pkg/.lintr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
linters: with_defaults(line_length_linter(100), camel_case_linter = NULL, open_curly_linter(allow_single_line = TRUE), closed_curly_linter(allow_single_line = TRUE))
1+
linters: with_defaults(line_length_linter(100), multiple_dots_linter = NULL, camel_case_linter = NULL, open_curly_linter(allow_single_line = TRUE), closed_curly_linter(allow_single_line = TRUE))
22
exclusions: list("inst/profile/general.R" = 1, "inst/profile/shell.R")

R/pkg/DESCRIPTION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Collate:
3535
'WindowSpec.R'
3636
'backend.R'
3737
'broadcast.R'
38+
'catalog.R'
3839
'client.R'
3940
'context.R'
4041
'deserialize.R'
@@ -43,6 +44,7 @@ Collate:
4344
'jvm.R'
4445
'mllib_classification.R'
4546
'mllib_clustering.R'
47+
'mllib_fpm.R'
4648
'mllib_recommendation.R'
4749
'mllib_regression.R'
4850
'mllib_stat.R'

R/pkg/NAMESPACE

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ exportMethods("glm",
6666
"spark.randomForest",
6767
"spark.gbt",
6868
"spark.bisectingKmeans",
69-
"spark.svmLinear")
69+
"spark.svmLinear",
70+
"spark.fpGrowth",
71+
"spark.freqItemsets",
72+
"spark.associationRules")
7073

7174
# Job group lifecycle management methods
7275
export("setJobGroup",
@@ -98,6 +101,7 @@ exportMethods("arrange",
98101
"createOrReplaceTempView",
99102
"crossJoin",
100103
"crosstab",
104+
"cube",
101105
"dapply",
102106
"dapplyCollect",
103107
"describe",
@@ -140,6 +144,7 @@ exportMethods("arrange",
140144
"registerTempTable",
141145
"rename",
142146
"repartition",
147+
"rollup",
143148
"sample",
144149
"sample_frac",
145150
"sampleBy",
@@ -177,7 +182,8 @@ exportMethods("arrange",
177182

178183
exportClasses("Column")
179184

180-
exportMethods("%in%",
185+
exportMethods("%<=>%",
186+
"%in%",
181187
"abs",
182188
"acos",
183189
"add_months",
@@ -200,6 +206,8 @@ exportMethods("%in%",
200206
"cbrt",
201207
"ceil",
202208
"ceiling",
209+
"collect_list",
210+
"collect_set",
203211
"column",
204212
"concat",
205213
"concat_ws",
@@ -210,6 +218,8 @@ exportMethods("%in%",
210218
"count",
211219
"countDistinct",
212220
"crc32",
221+
"create_array",
222+
"create_map",
213223
"hash",
214224
"cume_dist",
215225
"date_add",
@@ -225,6 +235,7 @@ exportMethods("%in%",
225235
"endsWith",
226236
"exp",
227237
"explode",
238+
"explode_outer",
228239
"expm1",
229240
"expr",
230241
"factorial",
@@ -238,6 +249,8 @@ exportMethods("%in%",
238249
"getField",
239250
"getItem",
240251
"greatest",
252+
"grouping_bit",
253+
"grouping_id",
241254
"hex",
242255
"histogram",
243256
"hour",
@@ -281,18 +294,21 @@ exportMethods("%in%",
281294
"nanvl",
282295
"negate",
283296
"next_day",
297+
"not",
284298
"ntile",
285299
"otherwise",
286300
"over",
287301
"percent_rank",
288302
"pmod",
289303
"posexplode",
304+
"posexplode_outer",
290305
"quarter",
291306
"rand",
292307
"randn",
293308
"rank",
294309
"regexp_extract",
295310
"regexp_replace",
311+
"repeat_string",
296312
"reverse",
297313
"rint",
298314
"rlike",
@@ -316,6 +332,7 @@ exportMethods("%in%",
316332
"sort_array",
317333
"soundex",
318334
"spark_partition_id",
335+
"split_string",
319336
"stddev",
320337
"stddev_pop",
321338
"stddev_samp",
@@ -358,9 +375,15 @@ export("as.DataFrame",
358375
"clearCache",
359376
"createDataFrame",
360377
"createExternalTable",
378+
"createTable",
379+
"currentDatabase",
361380
"dropTempTable",
362381
"dropTempView",
363382
"jsonFile",
383+
"listColumns",
384+
"listDatabases",
385+
"listFunctions",
386+
"listTables",
364387
"loadDF",
365388
"parquetFile",
366389
"read.df",
@@ -370,7 +393,11 @@ export("as.DataFrame",
370393
"read.parquet",
371394
"read.stream",
372395
"read.text",
396+
"recoverPartitions",
397+
"refreshByPath",
398+
"refreshTable",
373399
"setCheckpointDir",
400+
"setCurrentDatabase",
374401
"spark.lapply",
375402
"spark.addFile",
376403
"spark.getSparkFilesRootDirectory",

0 commit comments

Comments
 (0)