aboutsummaryrefslogtreecommitdiff
path: root/examples/src/main/python/transitive_closure.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/src/main/python/transitive_closure.py')
-rwxr-xr-xexamples/src/main/python/transitive_closure.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/src/main/python/transitive_closure.py b/examples/src/main/python/transitive_closure.py
index d88ea94e41..49551d4085 100755
--- a/examples/src/main/python/transitive_closure.py
+++ b/examples/src/main/python/transitive_closure.py
@@ -46,10 +46,8 @@ if __name__ == "__main__":
.appName("PythonTransitiveClosure")\
.getOrCreate()
- sc = spark.sparkContext
-
partitions = int(sys.argv[1]) if len(sys.argv) > 1 else 2
- tc = sc.parallelize(generateGraph(), partitions).cache()
+ tc = spark.sparkContext.parallelize(generateGraph(), partitions).cache()
# Linear transitive closure: each round grows paths by one edge,
# by joining the graph's edges with the already-discovered paths.