There are some questions in spark-ts.

54 views
Skip to first unread message

liuhoukai

unread,
May 9, 2018, 5:49:04 AM5/9/18
to spar...@googlegroups.com
Hello:
I’m interested in spark-timeseries which has development of your team in recent.It’s good.But I have some troubles when I use it.The following is my code:

val toRdd=   ...
val subslice=toRdd.slice(20180101000010L,20180101000012L)
But I get all records of the RDD.

I browse the source code.I find the question is generating in the following code:
def mapSeries[U](f: (Vector) => Vector): TimeSeriesRDD[K] = {
new TimeSeriesRDD[K](index, map(kt => (kt._1, f(kt._2))))
}
What I can’t understand is "map(kt => (kt._1, f(kt._2),I think it should slice the search results,but it doesnt seem like what I think.Can you answer it to me ?

The source data is:
20180101000009,7,8,4,6,87,8,4,6,87,8,4,6,8
20180101000010,7,3,7,4,17,3,7,4,17,3,7,4,1
20180101000011,4,0,4,2,84,0,4,2,84,0,4,2,8
20180101000012,9,0,4,2,29,0,4,2,29,0,4,2,2
20180101000013,5,2,5,2,45,2,5,2,45,2,5,2,4
20180101000014,6,7,6,2,16,7,6,2,16,7,6,2,1
20180101000015,4,3,1,7,44,3,1,7,44,3,1,7,4
20180101000016,3,6,4,2,33,6,4,2,33,6,4,2,3
20180101000017,3,4,7,4,43,4,7,4,43,4,7,4,4
Reply all
Reply to author
Forward
0 new messages