Skip to content

Commit 6fa70ba

Browse files
committed
Signed-off-by: Karen Feng <[email protected]>
2 parents e1719d3 + 6093a78 commit 6fa70ba

File tree

89 files changed

+2078
-529
lines changed

Some content is hidden

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

89 files changed

+2078
-529
lines changed

.github/workflows/build_and_test.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ jobs:
6161
excluded-tags: org.apache.spark.tags.SlowHiveTest
6262
comment: "- other tests"
6363
# SQL tests
64-
- modules: sql
65-
java: 8
66-
hadoop: hadoop3.2
67-
hive: hive2.3
68-
included-tags: org.apache.spark.tags.DedicatedJVMTest
69-
comment: "- dedicated JVM tests"
7064
- modules: sql
7165
java: 8
7266
hadoop: hadoop3.2
@@ -77,7 +71,7 @@ jobs:
7771
java: 8
7872
hadoop: hadoop3.2
7973
hive: hive2.3
80-
excluded-tags: org.apache.spark.tags.DedicatedJVMTest,org.apache.spark.tags.ExtendedSQLTest
74+
excluded-tags: org.apache.spark.tags.ExtendedSQLTest
8175
comment: "- other tests"
8276
env:
8377
MODULES_TO_TEST: ${{ matrix.modules }}
@@ -99,12 +93,11 @@ jobs:
9993
if: ${{ github.event.inputs.target != '' }}
10094
run: git merge --progress --ff-only origin/${{ github.event.inputs.target }}
10195
# Cache local repositories. Note that GitHub Actions cache has a 2G limit.
102-
- name: Cache Scala, SBT, Maven and Zinc
96+
- name: Cache Scala, SBT and Maven
10397
uses: actions/cache@v2
10498
with:
10599
path: |
106100
build/apache-maven-*
107-
build/zinc-*
108101
build/scala-*
109102
build/*.jar
110103
~/.sbt
@@ -186,12 +179,11 @@ jobs:
186179
if: ${{ github.event.inputs.target != '' }}
187180
run: git merge --progress --ff-only origin/${{ github.event.inputs.target }}
188181
# Cache local repositories. Note that GitHub Actions cache has a 2G limit.
189-
- name: Cache Scala, SBT, Maven and Zinc
182+
- name: Cache Scala, SBT and Maven
190183
uses: actions/cache@v2
191184
with:
192185
path: |
193186
build/apache-maven-*
194-
build/zinc-*
195187
build/scala-*
196188
build/*.jar
197189
~/.sbt
@@ -254,12 +246,11 @@ jobs:
254246
if: ${{ github.event.inputs.target != '' }}
255247
run: git merge --progress --ff-only origin/${{ github.event.inputs.target }}
256248
# Cache local repositories. Note that GitHub Actions cache has a 2G limit.
257-
- name: Cache Scala, SBT, Maven and Zinc
249+
- name: Cache Scala, SBT and Maven
258250
uses: actions/cache@v2
259251
with:
260252
path: |
261253
build/apache-maven-*
262-
build/zinc-*
263254
build/scala-*
264255
build/*.jar
265256
~/.sbt
@@ -297,12 +288,11 @@ jobs:
297288
- name: Checkout Spark repository
298289
uses: actions/checkout@v2
299290
# Cache local repositories. Note that GitHub Actions cache has a 2G limit.
300-
- name: Cache Scala, SBT, Maven and Zinc
291+
- name: Cache Scala, SBT and Maven
301292
uses: actions/cache@v2
302293
with:
303294
path: |
304295
build/apache-maven-*
305-
build/zinc-*
306296
build/scala-*
307297
build/*.jar
308298
~/.sbt

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ R/pkg/tests/fulltests/Rplots.pdf
3030
build/*.jar
3131
build/apache-maven*
3232
build/scala*
33-
build/zinc*
3433
cache
3534
checkpoint
3635
conf/*.cmd

R/pkg/NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ exportMethods("%<=>%",
371371
"pmod",
372372
"posexplode",
373373
"posexplode_outer",
374+
"product",
374375
"quarter",
375376
"radians",
376377
"raise_error",

R/pkg/R/functions.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,19 @@ setMethod("overlay",
15731573
column(jc)
15741574
})
15751575

1576+
#' @details
1577+
#' \code{product}: Returns the product of the values in a group.
1578+
#'
1579+
#' @rdname column_aggregate_functions
1580+
#' @aliases product product,Column-method
1581+
#' @note product since 3.2.0
1582+
setMethod("product",
1583+
signature(x = "Column"),
1584+
function(x) {
1585+
jc <- callJStatic("org.apache.spark.sql.functions", "product", x@jc)
1586+
column(jc)
1587+
})
1588+
15761589
#' @details
15771590
#' \code{quarter}: Extracts the quarter as an integer from a given date/timestamp/string.
15781591
#'

R/pkg/R/generics.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,10 @@ setGeneric("posexplode", function(x) { standardGeneric("posexplode") })
12511251
#' @name NULL
12521252
setGeneric("posexplode_outer", function(x) { standardGeneric("posexplode_outer") })
12531253

1254+
#' @rdname column_aggregate_functions
1255+
#' @name NULL
1256+
setGeneric("product", function(x) { standardGeneric("product") })
1257+
12541258
#' @rdname column_datetime_functions
12551259
#' @name NULL
12561260
setGeneric("quarter", function(x) { standardGeneric("quarter") })

R/pkg/tests/fulltests/test_sparkSQL.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,7 @@ test_that("column functions", {
14341434
c28 <- asc_nulls_first(c1) + asc_nulls_last(c1) +
14351435
desc_nulls_first(c1) + desc_nulls_last(c1)
14361436
c29 <- acosh(c1) + asinh(c1) + atanh(c1)
1437+
c30 <- product(c1) + product(c1 * 0.5)
14371438

14381439
# Test if base::is.nan() is exposed
14391440
expect_equal(is.nan(c("a", "b")), c(FALSE, FALSE))

assembly/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@
136136
<artifactId>spark-yarn_${scala.binary.version}</artifactId>
137137
<version>${project.version}</version>
138138
</dependency>
139+
<dependency>
140+
<groupId>org.apache.hadoop</groupId>
141+
<artifactId>hadoop-yarn-server-web-proxy</artifactId>
142+
</dependency>
139143
</dependencies>
140144
</profile>
141145
<profile>

build/mvn

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,6 @@ install_mvn() {
9191
fi
9292
}
9393

94-
# Install zinc under the build/ folder
95-
install_zinc() {
96-
local ZINC_VERSION=0.3.15
97-
ZINC_BIN="$(command -v zinc)"
98-
if [ "$ZINC_BIN" ]; then
99-
local ZINC_DETECTED_VERSION="$(zinc -version | head -n1 | awk '{print $5}')"
100-
fi
101-
102-
if [ $(version $ZINC_DETECTED_VERSION) -lt $(version $ZINC_VERSION) ]; then
103-
local zinc_path="zinc-${ZINC_VERSION}/bin/zinc"
104-
[ ! -f "${_DIR}/${zinc_path}" ] && ZINC_INSTALL_FLAG=1
105-
local TYPESAFE_MIRROR=${TYPESAFE_MIRROR:-https://downloads.lightbend.com}
106-
107-
install_app \
108-
"${TYPESAFE_MIRROR}/zinc/${ZINC_VERSION}" \
109-
"zinc-${ZINC_VERSION}.tgz" \
110-
"${zinc_path}"
111-
ZINC_BIN="${_DIR}/${zinc_path}"
112-
fi
113-
}
114-
11594
# Determine the Scala version from the root pom.xml file, set the Scala URL,
11695
# and, with that, download the specific version of Scala necessary under
11796
# the build/ folder
@@ -131,44 +110,20 @@ install_scala() {
131110
SCALA_LIBRARY="$(cd "$(dirname "${scala_bin}")/../lib" && pwd)/scala-library.jar"
132111
}
133112

134-
# Setup healthy defaults for the Zinc port if none were provided from
135-
# the environment
136-
ZINC_PORT=${ZINC_PORT:-"3030"}
137-
138-
# Install the proper version of Scala, Zinc and Maven for the build
139-
if [ "$(uname -m)" != 'aarch64' ]; then
140-
install_zinc
141-
fi
142113
install_scala
143114
install_mvn
144115

145116
# Reset the current working directory
146117
cd "${_CALLING_DIR}"
147118

148-
# Now that zinc is ensured to be installed, check its status and, if its
149-
# not running or just installed, start it
150-
if [ "$(uname -m)" != 'aarch64' ] && [ -n "${ZINC_INSTALL_FLAG}" -o -z "`"${ZINC_BIN}" -status -port ${ZINC_PORT}`" ]; then
151-
export ZINC_OPTS=${ZINC_OPTS:-"$_COMPILE_JVM_OPTS"}
152-
"${ZINC_BIN}" -shutdown -port ${ZINC_PORT}
153-
"${ZINC_BIN}" -start -port ${ZINC_PORT} \
154-
-server 127.0.0.1 -idle-timeout 3h \
155-
-scala-compiler "${SCALA_COMPILER}" \
156-
-scala-library "${SCALA_LIBRARY}" &>/dev/null
157-
fi
158-
159119
# Set any `mvn` options if not already present
160120
export MAVEN_OPTS=${MAVEN_OPTS:-"$_COMPILE_JVM_OPTS"}
161121

162122
echo "Using \`mvn\` from path: $MVN_BIN" 1>&2
163123

164124
# call the `mvn` command as usual
165125
# SPARK-25854
166-
"${MVN_BIN}" -DzincPort=${ZINC_PORT} "$@"
126+
"${MVN_BIN}" "$@"
167127
MVN_RETCODE=$?
168128

169-
# Try to shut down zinc explicitly if the server is still running.
170-
if [ "$(uname -m)" != 'aarch64' ]; then
171-
"${ZINC_BIN}" -shutdown -port ${ZINC_PORT}
172-
fi
173-
174129
exit $MVN_RETCODE

common/tags/src/test/java/org/apache/spark/tags/DedicatedJVMTest.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

core/src/main/scala/org/apache/spark/util/DependencyUtils.scala

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ private[spark] object DependencyUtils extends Logging {
5959
* @param uri Ivy URI need to be downloaded.
6060
* @return Tuple value of parameter `transitive` and `exclude` value.
6161
*
62-
* 1. transitive: whether to download dependency jar of Ivy URI, default value is false
63-
* and this parameter value is case-sensitive. Invalid value will be treat as false.
62+
* 1. transitive: whether to download dependency jar of Ivy URI, default value is true
63+
* and this parameter value is case-insensitive. This mimics Hive's behaviour for
64+
* parsing the transitive parameter. Invalid value will be treat as false.
6465
* Example: Input: exclude=org.mortbay.jetty:jetty&transitive=true
6566
* Output: true
6667
*
@@ -72,7 +73,7 @@ private[spark] object DependencyUtils extends Logging {
7273
private def parseQueryParams(uri: URI): (Boolean, String) = {
7374
val uriQuery = uri.getQuery
7475
if (uriQuery == null) {
75-
(false, "")
76+
(true, "")
7677
} else {
7778
val mapTokens = uriQuery.split("&").map(_.split("="))
7879
if (mapTokens.exists(isInvalidQueryString)) {
@@ -81,14 +82,15 @@ private[spark] object DependencyUtils extends Logging {
8182
}
8283
val groupedParams = mapTokens.map(kv => (kv(0), kv(1))).groupBy(_._1)
8384

84-
// Parse transitive parameters (e.g., transitive=true) in an Ivy URI, default value is false
85+
// Parse transitive parameters (e.g., transitive=true) in an Ivy URI, default value is true
8586
val transitiveParams = groupedParams.get("transitive")
8687
if (transitiveParams.map(_.size).getOrElse(0) > 1) {
8788
logWarning("It's best to specify `transitive` parameter in ivy URI query only once." +
8889
" If there are multiple `transitive` parameter, we will select the last one")
8990
}
9091
val transitive =
91-
transitiveParams.flatMap(_.takeRight(1).map(_._2 == "true").headOption).getOrElse(false)
92+
transitiveParams.flatMap(_.takeRight(1).map(_._2.equalsIgnoreCase("true")).headOption)
93+
.getOrElse(true)
9294

9395
// Parse an excluded list (e.g., exclude=org.mortbay.jetty:jetty,org.eclipse.jetty:jetty-http)
9496
// in an Ivy URI. When download Ivy URI jar, Spark won't download transitive jar
@@ -125,7 +127,7 @@ private[spark] object DependencyUtils extends Logging {
125127
* `parameter=value&parameter=value...`
126128
* Note that currently Ivy URI query part support two parameters:
127129
* 1. transitive: whether to download dependent jars related to your Ivy URI.
128-
* transitive=false or `transitive=true`, if not set, the default value is false.
130+
* transitive=false or `transitive=true`, if not set, the default value is true.
129131
* 2. exclude: exclusion list when download Ivy URI jar and dependency jars.
130132
* The `exclude` parameter content is a ',' separated `group:module` pair string :
131133
* `exclude=group:module,group:module...`

0 commit comments

Comments
 (0)