[BEAM-11637] Use accumulators properly in BitAnd.#13745
Merged
amaliujia merged 2 commits intoapache:masterfrom Jan 14, 2021
Merged
[BEAM-11637] Use accumulators properly in BitAnd.#13745amaliujia merged 2 commits intoapache:masterfrom
amaliujia merged 2 commits intoapache:masterfrom
Conversation
Author
|
Note that this doesn't solve BEAM-10379. Null inputs still aren't being passed in properly, so there must be a problem upstream. |
amaliujia
reviewed
Jan 13, 2021
| } else { | ||
| return null; | ||
| public Accum addInput(Accum accum, T input) { | ||
| if (input == null) { |
Contributor
There was a problem hiding this comment.
if (accum.isNull) then return?
Author
There was a problem hiding this comment.
It's not strictly necessary, but I added it for clarity.
| static class BitAnd<T extends Number> extends CombineFn<T, BitAnd.Accum, Long> { | ||
| static class Accum { | ||
| /** True if no inputs have been seen yet. */ | ||
| boolean isEmpty = true; |
Contributor
There was a problem hiding this comment.
question:
when isNull = true, will isEmpty be false or true, or we don't care isEmpty when NULL is seen?
Author
There was a problem hiding this comment.
If isNull is true, the other values become meaningless. I added a comment.
Author
|
cc: @sonam-vend |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
R: @amaliujia
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.