-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tumble windowing function #37
Add tumble windowing function #37
Conversation
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
Signed-off-by: Chen Dai <daichen@amazon.com>
// Delegate actual implementation to Spark existing window() function | ||
val timeColumn = children.head | ||
val windowDuration = children(1) | ||
window(new Column(timeColumn), windowDuration.toString()).expr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not using window function directly? tumble function is more align with streaming sql grammer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, currently tumble is just an alias of window. The reason for doing this is Streaming SQL has a family of windowing function, ex. tumbling, sliding, session etc. Tumbling window is one of them that happen to be supported by Spark window() function directly.
Description
Add
TUMBLE
windowing function which is required by materialized view support.The function generates a new column called
window
. It's a struct field consist ofstart
andend
field inside. The implementation is actually delegated to Spark existingwindow()
function. Here is an example:Issues Resolved
#25
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.