-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-270] Support Timestamps/Windows in Flink Batch #343
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
[BEAM-270] Support Timestamps/Windows in Flink Batch #343
Conversation
|
@kennknowles You added the (new) there are, however, no changes in those parts of the code and it also doesn't fail on Jenkins (or my machine). The only thing I could think about is the registrar. Or maybe you have an idea about what's going on. |
|
Also, on the java 8 travis profile this is running too long and being canceled. It seems that the java 8 build is taking way longer to finish, even before these changes. Anyone have any idea why that is? |
|
As for the Java 8 examples issue: My guess is the case is that on Travis we use Separately, I am not sure about the Java 8 tests being slow. I will take a look. |
|
For examples, I think I fixed it in my latest commit: the java 8 examples pom did not have a Failsafe plugin section like this: I think in the maven version on travis the most recently active I adde the section but I can't check whether it works because travis kills the tests before we reach that part. For the java-8-taking-to-long part I have a hunch that it could be that Javadoc/src-package building is not correctly disabled on our combination of Maven and Java 8. I don't have anything concrete there, though. |
|
I think Jenkins needs a kick; looks like it gave up due to a conflict, even though I don't see one. |
|
Is there something I can do to make it rerun the tests or do I have to push a dummy commit? |
|
I think just a dummy commit. My favorite method is to rebase onto |
36291c7 to
9865be2
Compare
|
I filed a JIRA issue some time ago but it's not possible according to Infra to rerun pull requests in Jenkins other than pushing a new version. |
|
Ah ok, If you look at all the recent PRs you'll notice that Jenkins fails for all of them with the same message. I wrote an email to the ML about this. |
d689dd7 to
54496c3
Compare
This makes the runner available for selection by integration tests.
Today Flink batch supports only global windows. This is a situation we intend our build to allow, eventually via JUnit category filtering. For now all the test classes that use non-global windows are excluded entirely via maven configuration. In the future, it should be on a per-test-method basis.
Without it the RunnableOnService tests seem to not work
With this change we always use WindowedValue<T> for the underlying Flink DataSets instead of just T. This allows us to support windowing as well. This changes also a lot of other stuff enabled by the above: - Use WindowedValue throughout - Add proper translation for Window.into() - Make side inputs window aware - Make GroupByKey and Combine transformations window aware, this includes support for merging windows. GroupByKey is implemented as a Combine with a concatenating CombineFn, for simplicity This removes Flink specific transformations for things that are handled by builtin sources/sinks, among other things this: - Removes special translation for AvroIO.Read/Write and TextIO.Read/Write - Removes special support for Write.Bound, this was not working properly and is now handled by the Beam machinery that uses DoFns for this - Removes special translation for binary Co-Group, the code was still in there but was never used With this change all RunnableOnService tests run on Flink Batch.
All of the stuff in the removed ITCases is covered (in more detail) by the RunnableOnService tests.
this can be done using a Sysout in a ParDo
54496c3 to
6c4af76
Compare
|
@kennknowles that's what I always used to do but I thought we're discouraging it because it messes with github comments. I finally found the reason why the Java 8 Examples tests were trying to run with the Flink runner. That POM doesn't have a surefire plugin section, so it does not explicitly set the I verified that this is actually what happens by printing the Before, this wasn't a problem because there we're no other POMs that were setting this property. |
|
Amusingly enough, since the commits were completely unchanged, the reported status from my PR applies here. |
|
Yes. I wonder if we have another way to improve the hygiene of our use of LGTM from me. This is great. I didn't make line-by-line comments on the side input stuff, but the change I described in that doc on the mailing list will affect the translation of |
|
Thanks, I'll also be following the developments. I was a nice trick with the copy-PR, I didn't know that the jenkins/travis status would then also apply to this PR. I guess it's because they have the same commit IDs. 😄 I'll merge, run a last time on travis and then commit. |
| TRANSLATORS.put(ParDo.BoundMulti.class, new ParDoBoundMultiTranslatorBatch()); | ||
| TRANSLATORS.put(ParDo.Bound.class, new ParDoBoundTranslatorBatch()); | ||
|
|
||
| TRANSLATORS.put(CoGroupByKey.class, new CoGroupByKeyTranslatorBatch()); |
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 do we remove the optimized CoGroupByKey translator? Is this within the scope of this PR?
|
Really great work @aljoscha! I would have liked to check out the changes in detail but didn't get to it before the merge. I'll leave a note next time to make this more explicit. Besides the great changes to the batch translation, there are some questionable cleanups that don't look like they should be part of this PR. Most prominently, the removal of the native translators and the test cases. |
|
The initial reason for the changes was to make all |
|
Fair enough. The |
|
Exactly. 😄 |
Switch StateSampler to Closeable
makes use of the updated plugin for generating DocFX YAMLs
This is a cleanup version of #328, this time for real.
The interesting things are in
FlinkPartialReduceFunction/FlinkReduceFunction,FlinkMergingPartialReduceFunction/FlinkMergingReduceFunctionandFlinkMergingNonShuffleReduceFunction. The handle all windowing. What theReduceFnRunnerwould do is implemented here but without any regard for triggers. All of these implement special cases of windowing: the first two are for general, non-merging windows, the second set is for doing aGroupByKey, the last one is for merging windows. In the last case we cannot do a pre-shuffle combine step because elements are not necessarily in the correct windows prior to the shuffle and merging of windows. We need to have the correct window for side-input access.R: @kennknowles and @mxm for review