Re: Finding previous and next element in a sorted RDD

2014-08-23 Thread Victor Tso-Guillen
by OrderedRDDFunction could know its neighbors. -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Finding-previous-and-next-element-in-a-sorted-RDD-tp12621p12664.html Sent from the Apache Spark User List mailing list archive at Nabble.com

Re: Finding previous and next element in a sorted RDD

2014-08-22 Thread Evan Chan
leftOuterJoin previous leftOuterJoin next Code looks clean to me, but I feel uneasy about the performance of join. -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Finding-previous-and-next-element-in-a-sorted-RDD-tp12621p12623.html Sent from the Apache

Re: Finding previous and next element in a sorted RDD

2014-08-22 Thread cjwang
It would be nice if an RDD that was massaged by OrderedRDDFunction could know its neighbors. -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Finding-previous-and-next-element-in-a-sorted-RDD-tp12621p12664.html Sent from the Apache Spark User List mailing

Finding previous and next element in a sorted RDD

2014-08-21 Thread cjwang
, tri.tail.head, tri.last) ) toList Now, in RDD, how do I do that (elegantly I hope)? I thought about zipping an RDD with shifted self, but there are some messy partition issues about zip. -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Finding-previous-and-next

Re: Finding previous and next element in a sorted RDD

2014-08-21 Thread cjwang
= idx.map(x = (x._2-1, x._1)) val joined = current leftOuterJoin previous leftOuterJoin next Code looks clean to me, but I feel uneasy about the performance of join. -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Finding-previous-and-next-element-in-a-sorted