def writeBatchData(b):
session = gradb.session()
session.run('UNWIND {batch} AS row CREATE (n:Node {v: row})', {'batch': b})
session.close()
uri = "****"
gradb=GraphDatabase.driver(uri, auth=(os.environ['NEO4JUSER'], os.environ['NEO4JPASS']), encrypted=False)
sc = SparkContext()
dt = sc.parallelize(range(1, 1000))
dt.foreach(writeBatchData)
Traceback (most recent call last):
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/serializers.py", line 710, in dumps
return cloudpickle.dumps(obj, pickle_protocol)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 1097, in dumps
cp.dump(obj)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 357, in dump
return Pickler.dump(self, obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 437, in dump
self.save(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 789, in save_tuple
save(element)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
self.save_function_tuple(obj)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 843, in _batch_appends
save(x)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
self.save_function_tuple(obj)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 843, in _batch_appends
save(x)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
self.save_function_tuple(obj)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 843, in _batch_appends
save(x)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
self.save_function_tuple(obj)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 843, in _batch_appends
save(x)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
self.save_function_tuple(obj)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 846, in _batch_appends
save(tmp[0])
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
self.save_function_tuple(obj)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 846, in _batch_appends
save(tmp[0])
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
self.save_function_tuple(obj)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 846, in _batch_appends
save(tmp[0])
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 496, in save_function
self.save_function_tuple(obj)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 890, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 549, in save
self.save_reduce(obj=obj, *rv)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 662, in save_reduce
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 549, in save
self.save_reduce(obj=obj, *rv)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 662, in save_reduce
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 890, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 549, in save
self.save_reduce(obj=obj, *rv)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 656, in save_reduce
self._batch_appends(listitems)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 846, in _batch_appends
save(tmp[0])
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 549, in save
self.save_reduce(obj=obj, *rv)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 662, in save_reduce
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 524, in save
rv = reduce(self.proto)
File "/home/ubuntu/anaconda3/lib/python3.7/socket.py", line 192, in __getstate__
raise TypeError("Cannot serialize socket object")
TypeError: Cannot serialize socket object
Traceback (most recent call last):
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/serializers.py", line 710, in dumps
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 1097, in dumps
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 357, in dump
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 437, in dump
self.save(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 789, in save_tuple
save(element)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 843, in _batch_appends
save(x)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 843, in _batch_appends
save(x)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 843, in _batch_appends
save(x)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 843, in _batch_appends
save(x)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 846, in _batch_appends
save(tmp[0])
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 846, in _batch_appends
save(tmp[0])
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 501, in save_function
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 819, in save_list
self._batch_appends(obj)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 846, in _batch_appends
save(tmp[0])
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 496, in save_function
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/cloudpickle.py", line 730, in save_function_tuple
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 890, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 549, in save
self.save_reduce(obj=obj, *rv)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 662, in save_reduce
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 549, in save
self.save_reduce(obj=obj, *rv)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 662, in save_reduce
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 890, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 549, in save
self.save_reduce(obj=obj, *rv)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 656, in save_reduce
self._batch_appends(listitems)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 846, in _batch_appends
save(tmp[0])
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 549, in save
self.save_reduce(obj=obj, *rv)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 662, in save_reduce
save(state)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 504, in save
f(self, obj) # Call unbound method with explicit self
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 859, in save_dict
self._batch_setitems(obj.items())
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 885, in _batch_setitems
save(v)
File "/home/ubuntu/anaconda3/lib/python3.7/pickle.py", line 524, in save
rv = reduce(self.proto)
File "/home/ubuntu/anaconda3/lib/python3.7/socket.py", line 192, in __getstate__
raise TypeError("Cannot serialize socket object")
TypeError: Cannot serialize socket object
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ubuntu/dev/birdview-patent-landscape/database-scripts/database.py", line 43, in <module>
dt.foreach(writeBatchData)
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/rdd.py", line 862, in foreach
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/rdd.py", line 1128, in count
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/rdd.py", line 1119, in sum
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/rdd.py", line 990, in fold
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/rdd.py", line 889, in collect
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/rdd.py", line 2616, in _jrdd
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/rdd.py", line 2504, in _wrap_function
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/rdd.py", line 2490, in _prepare_for_python_RDD
File "/usr/local/spark/python/lib/pyspark.zip/pyspark/serializers.py", line 720, in dumps
_pickle.PicklingError: Could not serialize object: TypeError: Cannot serialize socket object```
Sorry, above is the complete code and error message, thank you.