Skip to content

Commit e4cb42a

Browse files
committed
[SPARK-25891][PYTHON] Upgrade to Py4J 0.10.8.1
## What changes were proposed in this pull request? Py4J 0.10.8.1 is released on October 21st and is the first release of Py4J to support Python 3.7 officially. We had better have this to get the official support. Also, there are some patches related to garbage collections. https://www.py4j.org/changelog.html#py4j-0-10-8-and-py4j-0-10-8-1 ## How was this patch tested? Pass the Jenkins. Closes apache#22901 from dongjoon-hyun/SPARK-25891. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent b3af917 commit e4cb42a

File tree

14 files changed

+13
-12
lines changed

14 files changed

+13
-12
lines changed

bin/pyspark

+1-1
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.7-src.zip:$PYTHONPATH"
60+
export PYTHONPATH="${SPARK_HOME}/python/lib/py4j-0.10.8.1-src.zip:$PYTHONPATH"
6161

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

bin/pyspark2.cmd

+1-1
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.7-src.zip;%PYTHONPATH%
33+
set PYTHONPATH=%SPARK_HOME%\python\lib\py4j-0.10.8.1-src.zip;%PYTHONPATH%
3434

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

core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@
350350
<dependency>
351351
<groupId>net.sf.py4j</groupId>
352352
<artifactId>py4j</artifactId>
353-
<version>0.10.7</version>
353+
<version>0.10.8.1</version>
354354
</dependency>
355355
<dependency>
356356
<groupId>org.apache.spark</groupId>

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ 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.7-src.zip").mkString(File.separator)
35+
pythonPath +=
36+
Seq(sparkHome, "python", "lib", "py4j-0.10.8.1-src.zip").mkString(File.separator)
3637
}
3738
pythonPath ++= SparkContext.jarOfObject(this)
3839
pythonPath.mkString(File.pathSeparator)

dev/deps/spark-deps-hadoop-2.7

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ parquet-hadoop-1.10.0.jar
168168
parquet-hadoop-bundle-1.6.0.jar
169169
parquet-jackson-1.10.0.jar
170170
protobuf-java-2.5.0.jar
171-
py4j-0.10.7.jar
171+
py4j-0.10.8.1.jar
172172
pyrolite-4.13.jar
173173
scala-compiler-2.11.12.jar
174174
scala-library-2.11.12.jar

dev/deps/spark-deps-hadoop-3.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ parquet-hadoop-1.10.0.jar
186186
parquet-hadoop-bundle-1.6.0.jar
187187
parquet-jackson-1.10.0.jar
188188
protobuf-java-2.5.0.jar
189-
py4j-0.10.7.jar
189+
py4j-0.10.8.1.jar
190190
pyrolite-4.13.jar
191191
re2j-1.1.jar
192192
scala-compiler-2.11.12.jar

python/README.md

+1-1
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.7), but some additional sub-packages have their own extra requirements for some features (including numpy, pandas, and pyarrow).
32+
At its core PySpark depends on Py4J (currently version 0.10.8.1), but some additional sub-packages have their own extra requirements for some features (including numpy, pandas, and pyarrow).

python/docs/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ BUILDDIR ?= _build
3737
# 2. If both are set, SPHINXBUILD has a higher priority over SPHINXPYTHON
3838
# 3. By default, SPHINXBUILD is used as 'sphinx-build'.
3939

40-
export PYTHONPATH=$(realpath ..):$(realpath ../lib/py4j-0.10.7-src.zip)
40+
export PYTHONPATH=$(realpath ..):$(realpath ../lib/py4j-0.10.8.1-src.zip)
4141

4242
# Internal variables.
4343
PAPEROPT_a4 = -D latex_paper_size=a4

python/lib/py4j-0.10.7-src.zip

-41.4 KB
Binary file not shown.

python/lib/py4j-0.10.8.1-src.zip

40.3 KB
Binary file not shown.

python/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def _supports_symlinks():
201201
'pyspark.examples.src.main.python': ['*.py', '*/*.py']},
202202
scripts=scripts,
203203
license='http://www.apache.org/licenses/LICENSE-2.0',
204-
install_requires=['py4j==0.10.7'],
204+
install_requires=['py4j==0.10.8.1'],
205205
setup_requires=['pypandoc'],
206206
extras_require={
207207
'ml': ['numpy>=1.7'],

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ private[spark] class Client(
11691169
val pyArchivesFile = new File(pyLibPath, "pyspark.zip")
11701170
require(pyArchivesFile.exists(),
11711171
s"$pyArchivesFile not found; cannot run pyspark application in YARN mode.")
1172-
val py4jFile = new File(pyLibPath, "py4j-0.10.7-src.zip")
1172+
val py4jFile = new File(pyLibPath, "py4j-0.10.8.1-src.zip")
11731173
require(py4jFile.exists(),
11741174
s"$py4jFile not found; cannot run pyspark application in YARN mode.")
11751175
Seq(pyArchivesFile.getAbsolutePath(), py4jFile.getAbsolutePath())

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class YarnClusterSuite extends BaseYarnClusterSuite {
265265
// needed locations.
266266
val sparkHome = sys.props("spark.test.home")
267267
val pythonPath = Seq(
268-
s"$sparkHome/python/lib/py4j-0.10.7-src.zip",
268+
s"$sparkHome/python/lib/py4j-0.10.8.1-src.zip",
269269
s"$sparkHome/python")
270270
val extraEnvVars = Map(
271271
"PYSPARK_ARCHIVES_PATH" -> pythonPath.map("local:" + _).mkString(File.pathSeparator),

sbin/spark-config.sh

+1-1
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.7-src.zip:${PYTHONPATH}"
31+
export PYTHONPATH="${SPARK_HOME}/python/lib/py4j-0.10.8.1-src.zip:${PYTHONPATH}"
3232
export PYSPARK_PYTHONPATH_SET=1
3333
fi

0 commit comments

Comments
 (0)