cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

DB Connect giving different results

User16869510359
Esteemed Contributor

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)

1 ACCEPTED SOLUTION

Accepted Solutions

User16869510359
Esteemed Contributor

This is a known limitation that accumulators do not work with DB Connect.

View solution in original post

1 REPLY 1

User16869510359
Esteemed Contributor

This is a known limitation that accumulators do not work with DB Connect.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.