Skip to content

[BEAM-11637] Use accumulators properly in BitAnd.#13745

Merged
amaliujia merged 2 commits intoapache:masterfrom
ibzib:BEAM-11637
Jan 14, 2021
Merged

[BEAM-11637] Use accumulators properly in BitAnd.#13745
amaliujia merged 2 commits intoapache:masterfrom
ibzib:BEAM-11637

Conversation

@ibzib
Copy link
Copy Markdown

@ibzib ibzib commented Jan 13, 2021

R: @amaliujia


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Dataflow Flink Samza Spark Twister2
Go Build Status --- Build Status --- Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status
Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
--- Build Status ---
XLang Build Status Build Status Build Status --- Build Status ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status --- --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@ibzib
Copy link
Copy Markdown
Author

ibzib commented Jan 13, 2021

Note that this doesn't solve BEAM-10379. Null inputs still aren't being passed in properly, so there must be a problem upstream.

} else {
return null;
public Accum addInput(Accum accum, T input) {
if (input == null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (accum.isNull) then return?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question:

when isNull = true, will isEmpty be false or true, or we don't care isEmpty when NULL is seen?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If isNull is true, the other values become meaningless. I added a comment.

@ibzib
Copy link
Copy Markdown
Author

ibzib commented Jan 13, 2021

cc: @sonam-vend

Copy link
Copy Markdown
Contributor

@amaliujia amaliujia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@amaliujia amaliujia merged commit 6675586 into apache:master Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants