Skip to content

Commit 3839cf4

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents df82d51 + f654b39 commit 3839cf4

File tree

134 files changed

+2130
-748
lines changed

Some content is hidden

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

134 files changed

+2130
-748
lines changed

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/R/DataFrame.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,14 +2818,14 @@ setMethod("write.df",
28182818
signature(df = "SparkDataFrame"),
28192819
function(df, path = NULL, source = NULL, mode = "error", ...) {
28202820
if (!is.null(path) && !is.character(path)) {
2821-
stop("path should be charactor, NULL or omitted.")
2821+
stop("path should be character, NULL or omitted.")
28222822
}
28232823
if (!is.null(source) && !is.character(source)) {
28242824
stop("source should be character, NULL or omitted. It is the datasource specified ",
28252825
"in 'spark.sql.sources.default' configuration by default.")
28262826
}
28272827
if (!is.character(mode)) {
2828-
stop("mode should be charactor or omitted. It is 'error' by default.")
2828+
stop("mode should be character or omitted. It is 'error' by default.")
28292829
}
28302830
if (is.null(source)) {
28312831
source <- getDefaultSqlSource()
@@ -3040,7 +3040,7 @@ setMethod("fillna",
30403040
signature(x = "SparkDataFrame"),
30413041
function(x, value, cols = NULL) {
30423042
if (!(class(value) %in% c("integer", "numeric", "character", "list"))) {
3043-
stop("value should be an integer, numeric, charactor or named list.")
3043+
stop("value should be an integer, numeric, character or named list.")
30443044
}
30453045

30463046
if (class(value) == "list") {
@@ -3052,7 +3052,7 @@ setMethod("fillna",
30523052
# Check each item in the named list is of valid type
30533053
lapply(value, function(v) {
30543054
if (!(class(v) %in% c("integer", "numeric", "character"))) {
3055-
stop("Each item in value should be an integer, numeric or charactor.")
3055+
stop("Each item in value should be an integer, numeric or character.")
30563056
}
30573057
})
30583058

@@ -3598,7 +3598,7 @@ setMethod("write.stream",
35983598
"in 'spark.sql.sources.default' configuration by default.")
35993599
}
36003600
if (!is.null(outputMode) && !is.character(outputMode)) {
3601-
stop("outputMode should be charactor or omitted.")
3601+
stop("outputMode should be character or omitted.")
36023602
}
36033603
if (is.null(source)) {
36043604
source <- getDefaultSqlSource()

R/pkg/R/SQLContext.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ tableToDF <- function(tableName) {
606606
#' @note read.df since 1.4.0
607607
read.df.default <- function(path = NULL, source = NULL, schema = NULL, na.strings = "NA", ...) {
608608
if (!is.null(path) && !is.character(path)) {
609-
stop("path should be charactor, NULL or omitted.")
609+
stop("path should be character, NULL or omitted.")
610610
}
611611
if (!is.null(source) && !is.character(source)) {
612612
stop("source should be character, NULL or omitted. It is the datasource specified ",

R/pkg/R/functions.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,12 +2438,12 @@ setMethod("date_format", signature(y = "Column", x = "character"),
24382438
#' from_json
24392439
#'
24402440
#' Parses a column containing a JSON string into a Column of \code{structType} with the specified
2441-
#' \code{schema} or array of \code{structType} if \code{asJsonArray} is set to \code{TRUE}.
2441+
#' \code{schema} or array of \code{structType} if \code{as.json.array} is set to \code{TRUE}.
24422442
#' If the string is unparseable, the Column will contains the value NA.
24432443
#'
24442444
#' @param x Column containing the JSON string.
24452445
#' @param schema a structType object to use as the schema to use when parsing the JSON string.
2446-
#' @param asJsonArray indicating if input string is JSON array of objects or a single object.
2446+
#' @param as.json.array indicating if input string is JSON array of objects or a single object.
24472447
#' @param ... additional named properties to control how the json is parsed, accepts the same
24482448
#' options as the JSON data source.
24492449
#'
@@ -2459,8 +2459,8 @@ setMethod("date_format", signature(y = "Column", x = "character"),
24592459
#'}
24602460
#' @note from_json since 2.2.0
24612461
setMethod("from_json", signature(x = "Column", schema = "structType"),
2462-
function(x, schema, asJsonArray = FALSE, ...) {
2463-
if (asJsonArray) {
2462+
function(x, schema, as.json.array = FALSE, ...) {
2463+
if (as.json.array) {
24642464
jschema <- callJStatic("org.apache.spark.sql.types.DataTypes",
24652465
"createArrayType",
24662466
schema$jobj)

R/pkg/inst/tests/testthat/test_sparkSQL.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,7 @@ test_that("column functions", {
14541454
jsonArr <- "[{\"name\":\"Bob\"}, {\"name\":\"Alice\"}]"
14551455
df <- as.DataFrame(list(list("people" = jsonArr)))
14561456
schema <- structType(structField("name", "string"))
1457-
arr <- collect(select(df, alias(from_json(df$people, schema, asJsonArray = TRUE), "arrcol")))
1457+
arr <- collect(select(df, alias(from_json(df$people, schema, as.json.array = TRUE), "arrcol")))
14581458
expect_equal(ncol(arr), 1)
14591459
expect_equal(nrow(arr), 1)
14601460
expect_is(arr[[1]][[1]], "list")
@@ -2926,9 +2926,9 @@ test_that("Call DataFrameWriter.save() API in Java without path and check argume
29262926
paste("source should be character, NULL or omitted. It is the datasource specified",
29272927
"in 'spark.sql.sources.default' configuration by default."))
29282928
expect_error(write.df(df, path = c(3)),
2929-
"path should be charactor, NULL or omitted.")
2929+
"path should be character, NULL or omitted.")
29302930
expect_error(write.df(df, mode = TRUE),
2931-
"mode should be charactor or omitted. It is 'error' by default.")
2931+
"mode should be character or omitted. It is 'error' by default.")
29322932
})
29332933

29342934
test_that("Call DataFrameWriter.load() API in Java without path and check argument types", {
@@ -2947,7 +2947,7 @@ test_that("Call DataFrameWriter.load() API in Java without path and check argume
29472947

29482948
# Arguments checking in R side.
29492949
expect_error(read.df(path = c(3)),
2950-
"path should be charactor, NULL or omitted.")
2950+
"path should be character, NULL or omitted.")
29512951
expect_error(read.df(jsonPath, source = c(1, 2)),
29522952
paste("source should be character, NULL or omitted. It is the datasource specified",
29532953
"in 'spark.sql.sources.default' configuration by default."))

core/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
<name>Spark Project Core</name>
3434
<url>http://spark.apache.org/</url>
3535
<dependencies>
36+
<dependency>
37+
<groupId>org.apache.avro</groupId>
38+
<artifactId>avro</artifactId>
39+
</dependency>
3640
<dependency>
3741
<groupId>org.apache.avro</groupId>
3842
<artifactId>avro-mapred</artifactId>

core/src/main/scala/org/apache/spark/rpc/RpcEndpoint.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private[spark] trait RpcEnvFactory {
3535
*
3636
* The life-cycle of an endpoint is:
3737
*
38-
* constructor -> onStart -> receive* -> onStop
38+
* {@code constructor -> onStart -> receive* -> onStop}
3939
*
4040
* Note: `receive` can be called concurrently. If you want `receive` to be thread-safe, please use
4141
* [[ThreadSafeRpcEndpoint]]
@@ -63,16 +63,16 @@ private[spark] trait RpcEndpoint {
6363
}
6464

6565
/**
66-
* Process messages from [[RpcEndpointRef.send]] or [[RpcCallContext.reply)]]. If receiving a
67-
* unmatched message, [[SparkException]] will be thrown and sent to `onError`.
66+
* Process messages from `RpcEndpointRef.send` or `RpcCallContext.reply`. If receiving a
67+
* unmatched message, `SparkException` will be thrown and sent to `onError`.
6868
*/
6969
def receive: PartialFunction[Any, Unit] = {
7070
case _ => throw new SparkException(self + " does not implement 'receive'")
7171
}
7272

7373
/**
74-
* Process messages from [[RpcEndpointRef.ask]]. If receiving a unmatched message,
75-
* [[SparkException]] will be thrown and sent to `onError`.
74+
* Process messages from `RpcEndpointRef.ask`. If receiving a unmatched message,
75+
* `SparkException` will be thrown and sent to `onError`.
7676
*/
7777
def receiveAndReply(context: RpcCallContext): PartialFunction[Any, Unit] = {
7878
case _ => context.sendFailure(new SparkException(self + " won't reply anything"))

core/src/main/scala/org/apache/spark/rpc/RpcTimeout.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import org.apache.spark.SparkConf
2626
import org.apache.spark.util.{ThreadUtils, Utils}
2727

2828
/**
29-
* An exception thrown if RpcTimeout modifies a [[TimeoutException]].
29+
* An exception thrown if RpcTimeout modifies a `TimeoutException`.
3030
*/
3131
private[rpc] class RpcTimeoutException(message: String, cause: TimeoutException)
3232
extends TimeoutException(message) { initCause(cause) }

core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ class DAGScheduler(
607607
* @param resultHandler callback to pass each result to
608608
* @param properties scheduler properties to attach to this job, e.g. fair scheduler pool name
609609
*
610-
* @throws Exception when the job fails
610+
* @note Throws `Exception` when the job fails
611611
*/
612612
def runJob[T, U](
613613
rdd: RDD[T],
@@ -644,7 +644,7 @@ class DAGScheduler(
644644
*
645645
* @param rdd target RDD to run tasks on
646646
* @param func a function to run on each partition of the RDD
647-
* @param evaluator [[ApproximateEvaluator]] to receive the partial results
647+
* @param evaluator `ApproximateEvaluator` to receive the partial results
648648
* @param callSite where in the user program this job was called
649649
* @param timeout maximum time to wait for the job, in milliseconds
650650
* @param properties scheduler properties to attach to this job, e.g. fair scheduler pool name

core/src/main/scala/org/apache/spark/scheduler/ExternalClusterManager.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private[spark] trait ExternalClusterManager {
4242

4343
/**
4444
* Create a scheduler backend for the given SparkContext and scheduler. This is
45-
* called after task scheduler is created using [[ExternalClusterManager.createTaskScheduler()]].
45+
* called after task scheduler is created using `ExternalClusterManager.createTaskScheduler()`.
4646
* @param sc SparkContext
4747
* @param masterURL the master URL
4848
* @param scheduler TaskScheduler that will be used with the scheduler backend.

0 commit comments

Comments
 (0)