Closed soloman817 closed 5 years ago
There is no efficient way to get the end time. It doesn't store end time internally (because it doesn't scan through to the end of the data when constructing a time series RDD).
Thanks for the reply. So currently I have to use ts.toDF.orderBy(new Column(timeColumnName).desc).take(1).head.getAs[Long](timeColumnName)
to get it. It is not efficient, but with cache, it might be better.
I have a time series RDD object, and I know internally it is sorted by the timestamps. What is the efficient way to get the start time and last time? There is a
TimeSeriesRDD.first
which returns the first row, so I can get the start time. But how to get the last row efficiently?