Skip to content

Instantly share code, notes, and snippets.

@kerinin
Last active March 20, 2019 00:05
Show Gist options
  • Save kerinin/134858b540f39b5692af632e195d1d1b to your computer and use it in GitHub Desktop.
Save kerinin/134858b540f39b5692af632e195d1d1b to your computer and use it in GitHub Desktop.
object Main {
def main(args: Array[String]) {
val env = StreamExecutionEnvironment.getExecutionEnvironment
clicks = env.readFile("myclicks.txt")
result = clicks
.map(new ClickTransformer)
.keyBy(0)
.window(EventTimeSessionWindows.withGap(Time.minutes(30L)))
.reduce(new ClickReducer)
result.writeAsText("output.txt")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment