I am working with PySpark using mixin factory of two classes
But each time map function is called the kernel just break, tried to debug and find relevant solution but didn't find any support .
At the moment I have multiple classes, those classes are called as according to the needs Interestingly, this format worked on previous version of Spark (1.6) but don't work with latest Spark 2.0 later
I believe its due to conflicting similar meta-class name among workers...
so, correction or some reference would be deeply appreciated
def mixin_factory(name, base, mixin):
class _tmp(base, mixin):
pass
_tmp.__name__ = name
return _tmp
def Mix_map_function(dataframe) :
MixClass = mixin_factory("MixClass", Class_A, Class_B)
MixClass( .... , dataframe ) # class initialization parameters using constructor
PiplinedRDD.map(lambda x: Mix_map_function(x[0]) , preservesPartitioning=True )
# x[0] some partitioned data from rdd