Last active
November 21, 2019 16:26
-
-
Save josep2/62149b232182b09c629352ff7d004055 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
case class Sale(id: String, amount: Double) | |
val sales: DataStream[Sale] = env.addSource( SOME_STREAMING_SOURCE) // Read in a stream that is typed as a Sale | |
sales.window(Count.of(50)).every(Time.of(1, TimeUnit.SECONDS)).sum("amount") // Every second sum the sales |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment