stack over flow when compiling scala code in maven due to duplicate names -
i need make changes class in package did not want loose initial class. copy class , paste in same project , changes name of functions , classes when try compile package new class in maven, stack on flow exception. here error message:
[info] [info] last tree typer: typetree(class customermiddlecombo) [info] symbol: class customermiddlecombo in package churnstory (fl ags: ) [info] symbol definition: class customermiddlecombo extends serializable [info] tpe: com.cloudera.sa.bell.churnstory.customermiddlecombo [info] symbol owners: class customermiddlecombo -> package churnstory [info] context owners: method apply -> anonymous class $anonfun -> method generatedcombocountmore -> object combocounterjobm5 -> package churnstory [info] [info] == enclosing template or block == [info] [info] apply( // val custid(): string in class userandsingleseqcounts [info] "r"."custid" // val custid(): string in class userandsingleseqcounts [info] nil [info] ) [info] [info] == expanded type of tree == [info] [info] typeref(typesymbol(class customermiddlecombo extends serializable)) [info] [error] uncaught exception during compilation: java.lang.stackoverflowerror [error] error: java.lang.stackoverflowerror
i thing there should problem having class or objects or maybe functions same name in scala package, have changed names in new class. if rid of new class(which not have new line) can compile package without problem! can me problem?
here part of code throws exception:
combocountsrdd.map(r => { val sortedorderedcounts2 = r.origorderedcounts.sortedcounts r.custid + "," + //custid dateformat.format(currentdate) + "," + //generated_record_dt dateformat.format(new date(r.timeofrootevent)) + "," + //z r.origorderedcounts.seq + "," + //orig_order_seq r.origorderedcounts.totalcount + "," + //orig_order_total_count convertmillisecondstodays(r.origorderedcounts.mintimefromrootevent) + "," + //orig_order_min_time_from_root convertmillisecondstodays(r.origorderedcounts.totaltimefromrootevent / r.origorderedcounts.totalcount.todouble) + "," + //orig_order_avg_time_from_root r.origorderedcounts.countoftimefromrooteventwithinaweek + "," + //orig_order_with_in_week_of_root r.origorderedcounts.countoftimefromrooteventwithinamonth + "," + //orig_order_with_in_month_of_root r.origorderedcounts.countoftimefromrooteventwithinaqrt + "," + //orig_order_with_in_qrt_of_root convertmillisecondstodays(r.origorderedcounts.mintimeoverlifeofseq) + "," + //orig_order_min_seq_time convertmillisecondstodays(r.origorderedcounts.totaltimeoverlifeofseq / r.origorderedcounts.totalcount.todouble) + "," + //orig_order_avg_seq_time r.origorderedcounts.countoftimeoverlifeofseqwithinaweek + "," + //orig_order_with_in_week_over_seq r.origorderedcounts.countoftimeoverlifeofseqwithinamonth + "," + //orig_order_with_in_month_over_seq r.origorderedcounts.countoftimeoverlifeofseqwithinaqrt + "," + //orig_order_with_in_qrt_over_seq convertmillisecondstodays(r.origorderedcounts.mintimefromnow) + "," + //orig_order_min_time_from_now convertmillisecondstodays(r.origorderedcounts.totaltimefromnow / r.origorderedcounts.totalcount.todouble) + "," + //orig_order_avg_time_from_now r.origorderedcounts.countoftimefromnowwithinaweek + "," + //orig_order_with_in_week_of_now r.origorderedcounts.countoftimefromnowwithinamonth + "," + //orig_order_with_in_month_of_now r.origorderedcounts.countoftimefromnowwithinaqrt+","+ sortedorderedcounts2.seq + "," + //sort_order_seq sortedorderedcounts2.totalcount + "," + //sorted_order_total_count convertmillisecondstodays(sortedorderedcounts2.mintimefromrootevent) + "," + //sorted_order_min_time_from_root //convertmillisecondstodays(sortedorderedcounts2.totaltimefromrootevent / sortedorderedcounts2.totalcount.todouble) + "," + //sorted_order_avg_time_from_root-->exception sortedorderedcounts2.countoftimefromrooteventwithinaweek + "," + //sorted_order_with_in_week_of_root sortedorderedcounts2.countoftimefromrooteventwithinamonth + "," + //sorted_order_with_in_month_of_root sortedorderedcounts2.countoftimefromrooteventwithinaqrt + "," + //sorted_order_with_in_qrt_of_root //convertmillisecondstodays(sortedorderedcounts2.mintimeoverlifeofseq) + "," + //sorted_order_min_seq_time-->exception //convertmillisecondstodays(sortedorderedcounts2.totaltimeoverlifeofseq / sortedorderedcounts2.totalcount.todouble) + "," + //sorted_order_avg_seq_time-->exception sortedorderedcounts2.countoftimeoverlifeofseqwithinaweek + "," + //sorted_order_with_in_week_over_seq sortedorderedcounts2.countoftimeoverlifeofseqwithinamonth + "," + //sorted_order_with_in_month_over_seq sortedorderedcounts2.countoftimeoverlifeofseqwithinaqrt + "," + //sorted_order_with_in_qrt_over_seq //convertmillisecondstodays(sortedorderedcounts2.mintimefromnow) + "," //sorted_order_min_time_from_now-->exception //convertmillisecondstodays(sortedorderedcounts2.totaltimefromnow / sortedorderedcounts2.totalcount.todouble) + ","// + //sorted_order_avg_time_from_now -->exception //sortedorderedcounts2.countoftimefromnowwithinaweek + "," //+ //sorted_order_with_in_week_of_now-->exception //sortedorderedcounts2.countoftimefromnowwithinamonth + ","// + //sorted_order_with_in_month_of_now-->exception sortedorderedcounts2.countoftimefromnowwithinaqrt //orig_order_with_in_qrt_of_now*/ }).saveastextfile(outputpath)
i test code line line, lines comment out , exception in end of them causing me problem. combocountsrdd type userandsingleseqcounts:
class userandsingleseqcounts(val custid: string,val timeofrootevent: long, val origorderedcounts: totalcountsandsubcounts) extends serializable {}
and origorderedcounts has nested structure this:
class totalcountsandsubcounts(var seq: string, var totalcount: long, var mintimefromrootevent: long, var totaltimefromrootevent: long, var countoftimefromrooteventwithinaweek: int, var countoftimefromrooteventwithinamonth: int, var countoftimefromrooteventwithinaqrt: int, var mintimeoverlifeofseq: long, var totaltimeoverlifeofseq: long, var countoftimeoverlifeofseqwithinaweek: int, var countoftimeoverlifeofseqwithinamonth: int, var countoftimeoverlifeofseqwithinaqrt: int, var mintimefromnow: long, var totaltimefromnow: long, var countoftimefromnowwithinaweek: int, var countoftimefromnowwithinamonth: int, var countoftimefromnowwithinaqrt: int, var countofdifferentorders: int, var sortedcounts: totalcountsandsubcounts) extends serializable
i confused: why requesting , not attributes sortedorderedcounts2 cause exception in compile time!
Comments
Post a Comment