Skip to content

Commit cc9c416

Browse files
committed
Merge conflict
2 parents 6ad35c9 + ea010a2 commit cc9c416

File tree

444 files changed

+12637
-5102
lines changed

Some content is hidden

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

444 files changed

+12637
-5102
lines changed

.github/workflows/master.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ jobs:
2323

2424
steps:
2525
- uses: actions/checkout@master
26+
# We split caches because GitHub Action Cache has a 400MB-size limit.
27+
- uses: actions/cache@v1
28+
with:
29+
path: ~/.m2/repository/com
30+
key: ${{ matrix.java }}-${{ matrix.hadoop }}-maven-com-${{ hashFiles('**/pom.xml') }}
31+
restore-keys: |
32+
${{ matrix.java }}-${{ matrix.hadoop }}-maven-com-
33+
- uses: actions/cache@v1
34+
with:
35+
path: ~/.m2/repository/org
36+
key: ${{ matrix.java }}-${{ matrix.hadoop }}-maven-org-${{ hashFiles('**/pom.xml') }}
37+
restore-keys: |
38+
${{ matrix.java }}-${{ matrix.hadoop }}-maven-org-
2639
- name: Set up JDK ${{ matrix.java }}
2740
uses: actions/setup-java@v1
2841
with:
@@ -32,11 +45,12 @@ jobs:
3245
export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
3346
export MAVEN_CLI_OPTS="--no-transfer-progress"
3447
./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -P${{ matrix.hadoop }} -Phadoop-cloud -Djava.version=${{ matrix.java }} install
48+
rm -rf ~/.m2/repository/org/apache/spark
3549
3650
3751
lint:
3852
runs-on: ubuntu-latest
39-
name: Linters
53+
name: Linters (Java/Scala/Python), licenses, dependencies
4054
steps:
4155
- uses: actions/checkout@master
4256
- uses: actions/setup-java@v1
@@ -58,3 +72,26 @@ jobs:
5872
run: ./dev/check-license
5973
- name: Dependencies
6074
run: ./dev/test-dependencies.sh
75+
76+
lintr:
77+
runs-on: ubuntu-latest
78+
name: Linter (R)
79+
steps:
80+
- uses: actions/checkout@master
81+
- uses: actions/setup-java@v1
82+
with:
83+
java-version: '11'
84+
- name: install R
85+
run: |
86+
echo 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' | sudo tee -a /etc/apt/sources.list
87+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
88+
sudo apt-get update
89+
sudo apt-get install -y r-base r-base-dev libcurl4-openssl-dev
90+
- name: install R packages
91+
run: |
92+
sudo Rscript -e "install.packages(c('curl', 'xml2', 'httr', 'devtools', 'testthat', 'knitr', 'rmarkdown', 'roxygen2', 'e1071', 'survival'), repos='https://cloud.r-project.org/')"
93+
sudo Rscript -e "devtools::install_github('jimhester/[email protected]')"
94+
- name: package and install SparkR
95+
run: ./R/install-dev.sh
96+
- name: lint-r
97+
run: ./dev/lint-r

LICENSE-binary

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ com.github.scopt:scopt_2.12
502502
core/src/main/resources/org/apache/spark/ui/static/dagre-d3.min.js
503503
core/src/main/resources/org/apache/spark/ui/static/*dataTables*
504504
core/src/main/resources/org/apache/spark/ui/static/graphlib-dot.min.js
505-
ore/src/main/resources/org/apache/spark/ui/static/jquery*
505+
core/src/main/resources/org/apache/spark/ui/static/jquery*
506506
core/src/main/resources/org/apache/spark/ui/static/sorttable.js
507507
docs/js/vendor/anchor.min.js
508508
docs/js/vendor/jquery*

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), multiple_dots_linter = NULL, object_name_linter = NULL, 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, object_name_linter = NULL, camel_case_linter = NULL, open_curly_linter(allow_single_line = TRUE), closed_curly_linter(allow_single_line = TRUE), object_usage_linter = NULL, cyclocomp_linter = NULL)
22
exclusions: list("inst/profile/general.R" = 1, "inst/profile/shell.R")

R/pkg/R/DataFrame.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,7 +2252,7 @@ setMethod("mutate",
22522252

22532253
# The last column of the same name in the specific columns takes effect
22542254
deDupCols <- list()
2255-
for (i in 1:length(cols)) {
2255+
for (i in seq_len(length(cols))) {
22562256
deDupCols[[ns[[i]]]] <- alias(cols[[i]], ns[[i]])
22572257
}
22582258

@@ -2416,7 +2416,7 @@ setMethod("arrange",
24162416
# builds a list of columns of type Column
24172417
# example: [[1]] Column Species ASC
24182418
# [[2]] Column Petal_Length DESC
2419-
jcols <- lapply(seq_len(length(decreasing)), function(i){
2419+
jcols <- lapply(seq_len(length(decreasing)), function(i) {
24202420
if (decreasing[[i]]) {
24212421
desc(getColumn(x, by[[i]]))
24222422
} else {
@@ -2749,7 +2749,7 @@ genAliasesForIntersectedCols <- function(x, intersectedColNames, suffix) {
27492749
col <- getColumn(x, colName)
27502750
if (colName %in% intersectedColNames) {
27512751
newJoin <- paste(colName, suffix, sep = "")
2752-
if (newJoin %in% allColNames){
2752+
if (newJoin %in% allColNames) {
27532753
stop("The following column name: ", newJoin, " occurs more than once in the 'DataFrame'.",
27542754
"Please use different suffixes for the intersected columns.")
27552755
}
@@ -3475,7 +3475,7 @@ setMethod("str",
34753475
cat(paste0("'", class(object), "': ", length(names), " variables:\n"))
34763476

34773477
if (nrow(localDF) > 0) {
3478-
for (i in 1 : ncol(localDF)) {
3478+
for (i in seq_len(ncol(localDF))) {
34793479
# Get the first elements for each column
34803480

34813481
firstElements <- if (types[i] == "character") {

R/pkg/R/SQLContext.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ writeToFileInArrow <- function(fileName, rdf, numPartitions) {
166166
for (rdf_slice in rdf_slices) {
167167
batch <- arrow::record_batch(rdf_slice)
168168
if (is.null(stream_writer)) {
169-
stream <- arrow::FileOutputStream(fileName)
169+
stream <- arrow::FileOutputStream$create(fileName)
170170
schema <- batch$schema
171-
stream_writer <- arrow::RecordBatchStreamWriter(stream, schema)
171+
stream_writer <- arrow::RecordBatchStreamWriter$create(stream, schema)
172172
}
173173

174174
stream_writer$write_batch(batch)
@@ -197,7 +197,7 @@ getSchema <- function(schema, firstRow = NULL, rdd = NULL) {
197197
as.list(schema)
198198
}
199199
if (is.null(names)) {
200-
names <- lapply(1:length(firstRow), function(x) {
200+
names <- lapply(seq_len(length(firstRow)), function(x) {
201201
paste0("_", as.character(x))
202202
})
203203
}
@@ -213,7 +213,7 @@ getSchema <- function(schema, firstRow = NULL, rdd = NULL) {
213213
})
214214

215215
types <- lapply(firstRow, infer_type)
216-
fields <- lapply(1:length(firstRow), function(i) {
216+
fields <- lapply(seq_len(length(firstRow)), function(i) {
217217
structField(names[[i]], types[[i]], TRUE)
218218
})
219219
schema <- do.call(structType, fields)

R/pkg/R/context.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ spark.getSparkFiles <- function(fileName) {
416416
#' @examples
417417
#'\dontrun{
418418
#' sparkR.session()
419-
#' doubled <- spark.lapply(1:10, function(x){2 * x})
419+
#' doubled <- spark.lapply(1:10, function(x) {2 * x})
420420
#'}
421421
#' @note spark.lapply since 2.0.0
422422
spark.lapply <- function(list, func) {

R/pkg/R/deserialize.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ readDeserializeInArrow <- function(inputCon) {
242242
# for now.
243243
dataLen <- readInt(inputCon)
244244
arrowData <- readBin(inputCon, raw(), as.integer(dataLen), endian = "big")
245-
batches <- arrow::RecordBatchStreamReader(arrowData)$batches()
245+
batches <- arrow::RecordBatchStreamReader$create(arrowData)$batches()
246246

247247
if (useAsTibble) {
248248
as_tibble <- get("as_tibble", envir = asNamespace("arrow"))

R/pkg/R/group.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ methods <- c("avg", "max", "mean", "min", "sum")
162162
#' @note pivot since 2.0.0
163163
setMethod("pivot",
164164
signature(x = "GroupedData", colname = "character"),
165-
function(x, colname, values = list()){
165+
function(x, colname, values = list()) {
166166
stopifnot(length(colname) == 1)
167167
if (length(values) == 0) {
168168
result <- callJMethod(x@sgd, "pivot", colname)

R/pkg/R/utils.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ hashCode <- function(key) {
131131
} else {
132132
asciiVals <- sapply(charToRaw(key), function(x) { strtoi(x, 16L) })
133133
hashC <- 0
134-
for (k in 1:length(asciiVals)) {
134+
for (k in seq_len(length(asciiVals))) {
135135
hashC <- mult31AndAdd(hashC, asciiVals[k])
136136
}
137137
as.integer(hashC)
@@ -728,7 +728,7 @@ assignNewEnv <- function(data) {
728728
stopifnot(length(cols) > 0)
729729

730730
env <- new.env()
731-
for (i in 1:length(cols)) {
731+
for (i in seq_len(length(cols))) {
732732
assign(x = cols[i], value = data[, cols[i], drop = F], envir = env)
733733
}
734734
env
@@ -754,7 +754,7 @@ launchScript <- function(script, combinedArgs, wait = FALSE, stdout = "", stderr
754754
if (.Platform$OS.type == "windows") {
755755
scriptWithArgs <- paste(script, combinedArgs, sep = " ")
756756
# on Windows, intern = F seems to mean output to the console. (documentation on this is missing)
757-
shell(scriptWithArgs, translate = TRUE, wait = wait, intern = wait) # nolint
757+
shell(scriptWithArgs, translate = TRUE, wait = wait, intern = wait)
758758
} else {
759759
# http://stat.ethz.ch/R-manual/R-devel/library/base/html/system2.html
760760
# stdout = F means discard output

R/pkg/inst/worker/worker.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ if (isEmpty != 0) {
194194
} else {
195195
# gapply mode
196196
outputs <- list()
197-
for (i in 1:length(data)) {
197+
for (i in seq_len(length(data))) {
198198
# Timing reading input data for execution
199199
inputElap <- elapsedSecs()
200200
output <- compute(mode, partition, serializer, deserializer, keys[[i]],

0 commit comments

Comments
 (0)