Skip to content

Commit 19fdb21

Browse files
zjffdurxin
authored andcommitted
[SPARK-12993][PYSPARK] Remove usage of ADD_FILES in pyspark
environment variable ADD_FILES is created for adding python files on spark context to be distributed to executors (SPARK-865), this is deprecated now. User are encouraged to use --py-files for adding python files. Author: Jeff Zhang <[email protected]> Closes apache#10913 from zjffdu/SPARK-12993.
1 parent 83507fe commit 19fdb21

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

python/pyspark/shell.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,10 @@
3232
from pyspark.sql import SQLContext, HiveContext
3333
from pyspark.storagelevel import StorageLevel
3434

35-
# this is the deprecated equivalent of ADD_JARS
36-
add_files = None
37-
if os.environ.get("ADD_FILES") is not None:
38-
add_files = os.environ.get("ADD_FILES").split(',')
39-
4035
if os.environ.get("SPARK_EXECUTOR_URI"):
4136
SparkContext.setSystemProperty("spark.executor.uri", os.environ["SPARK_EXECUTOR_URI"])
4237

43-
sc = SparkContext(pyFiles=add_files)
38+
sc = SparkContext()
4439
atexit.register(lambda: sc.stop())
4540

4641
try:
@@ -68,10 +63,6 @@
6863
platform.python_build()[1]))
6964
print("SparkContext available as sc, %s available as sqlContext." % sqlContext.__class__.__name__)
7065

71-
if add_files is not None:
72-
print("Warning: ADD_FILES environment variable is deprecated, use --py-files argument instead")
73-
print("Adding files: [%s]" % ", ".join(add_files))
74-
7566
# The ./bin/pyspark script stores the old PYTHONSTARTUP value in OLD_PYTHONSTARTUP,
7667
# which allows us to execute the user's PYTHONSTARTUP file:
7768
_pythonstartup = os.environ.get('OLD_PYTHONSTARTUP')

0 commit comments

Comments
 (0)