问题
I'm a newbie to spark. I have an RDD which looks likes this
12434|arizona|2016-10-11|000
56783|california|2016-10-12|111
23456|Texas|2016-10-11|234
I am trying to delete the blank line between 2nd and 3rd row. I tried val rdd2=rdd1.filter(x=>x!='\n')
but not working. Any suggestions how to resolve this will be helpful
回答1:
Try:
rdd1.filter(x => !x.isEmpty)
来源:https://stackoverflow.com/questions/40330276/deleting-blank-line-in-rdd