Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2021 12:54 PM
The below code gives different result when executed using DB Connect and a Notebook
sc = spark.sparkContext
a = sc.accumulator(0)
rdd = sc.parallelize([1, 2, 3])
def f(x):
global a
a.add(x)
rdd.foreach(f)
rdd.count()
print(a.value)
Labels:
- Labels:
-
DB Connect
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2021 12:55 PM
This is a known limitation that accumulators do not work with DB Connect.