Skip to content

Commit c8d0aba

Browse files
dongjoon-hyunholdenk
authored andcommitted
[SPARK-21278][PYSPARK] Upgrade to Py4J 0.10.6
## What changes were proposed in this pull request? This PR aims to bump Py4J in order to fix the following float/double bug. Py4J 0.10.5 fixes this (py4j/py4j#272) and the latest Py4J is 0.10.6. **BEFORE** ``` >>> df = spark.range(1) >>> df.select(df['id'] + 17.133574204226083).show() +--------------------+ |(id + 17.1335742042)| +--------------------+ | 17.1335742042| +--------------------+ ``` **AFTER** ``` >>> df = spark.range(1) >>> df.select(df['id'] + 17.133574204226083).show() +-------------------------+ |(id + 17.133574204226083)| +-------------------------+ | 17.133574204226083| +-------------------------+ ``` ## How was this patch tested? Manual. Author: Dongjoon Hyun <dongjoon@apache.org> Closes #18546 from dongjoon-hyun/SPARK-21278.
1 parent c8e7f44 commit c8d0aba

File tree

15 files changed

+13
-13
lines changed

15 files changed

+13
-13
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
263263
(New BSD license) Protocol Buffer Java API (org.spark-project.protobuf:protobuf-java:2.4.1-shaded - http://code.google.com/p/protobuf)
264264
(The BSD License) Fortran to Java ARPACK (net.sourceforge.f2j:arpack_combined_all:0.1 - http://f2j.sourceforge.net)
265265
(The BSD License) xmlenc Library (xmlenc:xmlenc:0.52 - http://xmlenc.sourceforge.net)
266-
(The New BSD License) Py4J (net.sf.py4j:py4j:0.10.4 - http://py4j.sourceforge.net/)
266+
(The New BSD License) Py4J (net.sf.py4j:py4j:0.10.6 - http://py4j.sourceforge.net/)
267267
(Two-clause BSD-style license) JUnit-Interface (com.novocode:junit-interface:0.10 - http://github.com/szeiger/junit-interface/)
268268
(BSD licence) sbt and sbt-launch-lib.bash
269269
(BSD 3 Clause) d3.min.js (https://github.com/mbostock/d3/blob/master/LICENSE)

bin/pyspark

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export PYSPARK_PYTHON
5757

5858
# Add the PySpark classes to the Python path:
5959
export PYTHONPATH="${SPARK_HOME}/python/:$PYTHONPATH"
60-
export PYTHONPATH="${SPARK_HOME}/python/lib/py4j-0.10.4-src.zip:$PYTHONPATH"
60+
export PYTHONPATH="${SPARK_HOME}/python/lib/py4j-0.10.6-src.zip:$PYTHONPATH"
6161

6262
# Load the PySpark shell.py script when ./pyspark is used interactively:
6363
export OLD_PYTHONSTARTUP="$PYTHONSTARTUP"

bin/pyspark2.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if "x%PYSPARK_DRIVER_PYTHON%"=="x" (
3030
)
3131

3232
set PYTHONPATH=%SPARK_HOME%\python;%PYTHONPATH%
33-
set PYTHONPATH=%SPARK_HOME%\python\lib\py4j-0.10.4-src.zip;%PYTHONPATH%
33+
set PYTHONPATH=%SPARK_HOME%\python\lib\py4j-0.10.6-src.zip;%PYTHONPATH%
3434

3535
set OLD_PYTHONSTARTUP=%PYTHONSTARTUP%
3636
set PYTHONSTARTUP=%SPARK_HOME%\python\pyspark\shell.py

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
<dependency>
336336
<groupId>net.sf.py4j</groupId>
337337
<artifactId>py4j</artifactId>
338-
<version>0.10.4</version>
338+
<version>0.10.6</version>
339339
</dependency>
340340
<dependency>
341341
<groupId>org.apache.spark</groupId>

core/src/main/scala/org/apache/spark/api/python/PythonUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private[spark] object PythonUtils {
3232
val pythonPath = new ArrayBuffer[String]
3333
for (sparkHome <- sys.env.get("SPARK_HOME")) {
3434
pythonPath += Seq(sparkHome, "python", "lib", "pyspark.zip").mkString(File.separator)
35-
pythonPath += Seq(sparkHome, "python", "lib", "py4j-0.10.4-src.zip").mkString(File.separator)
35+
pythonPath += Seq(sparkHome, "python", "lib", "py4j-0.10.6-src.zip").mkString(File.separator)
3636
}
3737
pythonPath ++= SparkContext.jarOfObject(this)
3838
pythonPath.mkString(File.pathSeparator)

dev/deps/spark-deps-hadoop-2.6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ parquet-jackson-1.8.2.jar
156156
pmml-model-1.2.15.jar
157157
pmml-schema-1.2.15.jar
158158
protobuf-java-2.5.0.jar
159-
py4j-0.10.4.jar
159+
py4j-0.10.6.jar
160160
pyrolite-4.13.jar
161161
scala-compiler-2.11.8.jar
162162
scala-library-2.11.8.jar

dev/deps/spark-deps-hadoop-2.7

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ parquet-jackson-1.8.2.jar
157157
pmml-model-1.2.15.jar
158158
pmml-schema-1.2.15.jar
159159
protobuf-java-2.5.0.jar
160-
py4j-0.10.4.jar
160+
py4j-0.10.6.jar
161161
pyrolite-4.13.jar
162162
scala-compiler-2.11.8.jar
163163
scala-library-2.11.8.jar

python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ The Python packaging for Spark is not intended to replace all of the other use c
2929

3030
## Python Requirements
3131

32-
At its core PySpark depends on Py4J (currently version 0.10.4), but additional sub-packages have their own requirements (including numpy and pandas).
32+
At its core PySpark depends on Py4J (currently version 0.10.6), but additional sub-packages have their own requirements (including numpy and pandas).

python/docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SPHINXBUILD ?= sphinx-build
77
PAPER ?=
88
BUILDDIR ?= _build
99

10-
export PYTHONPATH=$(realpath ..):$(realpath ../lib/py4j-0.10.4-src.zip)
10+
export PYTHONPATH=$(realpath ..):$(realpath ../lib/py4j-0.10.6-src.zip)
1111

1212
# User-friendly check for sphinx-build
1313
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)

python/lib/py4j-0.10.4-src.zip

-72.4 KB
Binary file not shown.

python/lib/py4j-0.10.6-src.zip

78.5 KB
Binary file not shown.

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def _supports_symlinks():
194194
'pyspark.examples.src.main.python': ['*.py', '*/*.py']},
195195
scripts=scripts,
196196
license='http://www.apache.org/licenses/LICENSE-2.0',
197-
install_requires=['py4j==0.10.4'],
197+
install_requires=['py4j==0.10.6'],
198198
setup_requires=['pypandoc'],
199199
extras_require={
200200
'ml': ['numpy>=1.7'],

resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ private[spark] class Client(
11241124
val pyArchivesFile = new File(pyLibPath, "pyspark.zip")
11251125
require(pyArchivesFile.exists(),
11261126
s"$pyArchivesFile not found; cannot run pyspark application in YARN mode.")
1127-
val py4jFile = new File(pyLibPath, "py4j-0.10.4-src.zip")
1127+
val py4jFile = new File(pyLibPath, "py4j-0.10.6-src.zip")
11281128
require(py4jFile.exists(),
11291129
s"$py4jFile not found; cannot run pyspark application in YARN mode.")
11301130
Seq(pyArchivesFile.getAbsolutePath(), py4jFile.getAbsolutePath())

resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class YarnClusterSuite extends BaseYarnClusterSuite {
249249
// needed locations.
250250
val sparkHome = sys.props("spark.test.home")
251251
val pythonPath = Seq(
252-
s"$sparkHome/python/lib/py4j-0.10.4-src.zip",
252+
s"$sparkHome/python/lib/py4j-0.10.6-src.zip",
253253
s"$sparkHome/python")
254254
val extraEnvVars = Map(
255255
"PYSPARK_ARCHIVES_PATH" -> pythonPath.map("local:" + _).mkString(File.pathSeparator),

sbin/spark-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ export SPARK_CONF_DIR="${SPARK_CONF_DIR:-"${SPARK_HOME}/conf"}"
2828
# Add the PySpark classes to the PYTHONPATH:
2929
if [ -z "${PYSPARK_PYTHONPATH_SET}" ]; then
3030
export PYTHONPATH="${SPARK_HOME}/python:${PYTHONPATH}"
31-
export PYTHONPATH="${SPARK_HOME}/python/lib/py4j-0.10.4-src.zip:${PYTHONPATH}"
31+
export PYTHONPATH="${SPARK_HOME}/python/lib/py4j-0.10.6-src.zip:${PYTHONPATH}"
3232
export PYSPARK_PYTHONPATH_SET=1
3333
fi

0 commit comments

Comments
 (0)