Skip to content

Instantly share code, notes, and snippets.

@quagly
Created October 9, 2019 16:43
Show Gist options
  • Save quagly/f901afa76fedc8fc1c098dda49da6d32 to your computer and use it in GitHub Desktop.
Save quagly/f901afa76fedc8fc1c098dda49da6d32 to your computer and use it in GitHub Desktop.
generate spark dataframe timeseries
val start_dttm = Timestamp.valueOf("2019-01-01 00:00:00")
val inlineDf = (1 to 4).map { i => ((new Timestamp(start_dttm.getTime() + 60000 * i) , i)) }.toDF("eventTime","eventValue")
display(inlineDf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment