Created
December 5, 2016 23:03
-
-
Save josep2/d1e7f0cd570e86b9951c088c88e01796 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.cloudera.sparkts._ | |
import java.time.{LocalDateTime, ZoneId, ZonedDateTime} | |
val zone = ZoneId.systemDefault() // We need to get a time zone, so I'll just use whatever is on the machine processing the data. | |
// Ideally, you would have the time zone for each data point before hand. | |
val dtIndex = DateTimeIndex.uniformFromInterval( | |
ZonedDateTime.of(LocalDateTime.parse("2016-01-04T00:00:00"), zone), // Look over a window from The first of January to the 3rd of october | |
ZonedDateTime.of(LocalDateTime.parse("2016-10-03T00:00:00"), zone), | |
new DayFrequency(7)) // Every seven days from Monday - Sunday will be an index |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment