scala - How to catch an exception that occurred on a spark worker? -
val htf = new hashingtf(50000) val tf = case.map(row=> htf.transform(row) ).cache() val idf = new idf().fit(tf) try { idf.transform(tf).map(x=>labeledpoint(1,x)) } catch { case ex:throwable=> println(ex.getmessage) } code isn't working.
hashingtf/idf belongs org.spark.mllib.feature.
i'm still getting exception says
org.apache.spark.sparkexception: failed broadcast_5_piece0 of broadcast_5 i cannot see of files in error log, how debug this?
it seems worker ran out of memory.
instant temporary fix:
run application without caching.
just remove .cache()
how debug:
probably spark ui might have complete exception details.
check stage details
check logs , thread dump in executor tab
if find multiple exceptions or errors try resolve in sequence.
most of times resolving 1st error resolve subsequent errors.
Comments
Post a Comment