diff options
author | Bryan Cutler <cutlerb@gmail.com> | 2016-05-25 14:29:14 -0700 |
---|---|---|
committer | Davies Liu <davies.liu@gmail.com> | 2016-05-25 14:29:14 -0700 |
commit | 9c297df3d4d5fa4bbfdffdaad15f362586db384b (patch) | |
tree | 37a39991a44fb0fb0fcb3ea7a841d4b399800468 /examples/src/main/python/avro_inputformat.py | |
parent | 698ef762f80cf4c84bc7b7cf083aa97d44b87170 (diff) | |
download | spark-9c297df3d4d5fa4bbfdffdaad15f362586db384b.tar.gz spark-9c297df3d4d5fa4bbfdffdaad15f362586db384b.tar.bz2 spark-9c297df3d4d5fa4bbfdffdaad15f362586db384b.zip |
[MINOR] [PYSPARK] [EXAMPLES] Changed examples to use SparkSession.sparkContext instead of _sc
## What changes were proposed in this pull request?
Some PySpark examples need a SparkContext and get it by accessing _sc directly from the session. These examples should use the provided property `sparkContext` in `SparkSession` instead.
## How was this patch tested?
Ran modified examples
Author: Bryan Cutler <cutlerb@gmail.com>
Closes #13303 from BryanCutler/pyspark-session-sparkContext-MINOR.
Diffstat (limited to 'examples/src/main/python/avro_inputformat.py')
-rw-r--r-- | examples/src/main/python/avro_inputformat.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/src/main/python/avro_inputformat.py b/examples/src/main/python/avro_inputformat.py index 3f65e8f79a..4422f9e7a9 100644 --- a/examples/src/main/python/avro_inputformat.py +++ b/examples/src/main/python/avro_inputformat.py @@ -70,7 +70,7 @@ if __name__ == "__main__": .appName("AvroKeyInputFormat")\ .getOrCreate() - sc = spark._sc + sc = spark.sparkContext conf = None if len(sys.argv) == 3: |