Skip to content

Commit

Permalink
space added after maps and renamed uniform index variable for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
josepablocam authored and sryza committed Aug 24, 2015
1 parent 6a7014f commit 41535b3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/main/scala/com/cloudera/sparkts/TimeSeriesRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ class TimeSeriesRDD(val index: DateTimeIndex, parent: RDD[(String, Vector[Double
}
// each record contains a value per time series, in original order
// and records are ordered by time
val unifIndex = index.asInstanceOf[UniformDateTimeIndex]
val instants = this.toInstants(nPartitions)
val start = unifIndex.first()
val rows = instants.map{ x =>
val rowIndex = unifIndex.frequency.difference(start, x._1)
val uniformIndex = index.asInstanceOf[UniformDateTimeIndex]
val instants = toInstants(nPartitions)
val start = uniformIndex.first()
val rows = instants.map { x =>
val rowIndex = uniformIndex.frequency.difference(start, x._1)
val rowData = Vectors.dense(x._2.toArray)
IndexedRow(rowIndex, rowData)
}
Expand All @@ -316,8 +316,8 @@ class TimeSeriesRDD(val index: DateTimeIndex, parent: RDD[(String, Vector[Double
* @return an equivalent RowMatrix
*/
def toRowMatrix(nPartitions: Int = -1): RowMatrix = {
val instants = this.toInstants(nPartitions)
val rows = instants.map{ x => Vectors.dense(x._2.toArray) }
val instants = toInstants(nPartitions)
val rows = instants.map { x => Vectors.dense(x._2.toArray) }
new RowMatrix(rows)
}

Expand Down

0 comments on commit 41535b3

Please sign in to comment.