Skip to content

Conversation

@lukecwik
Copy link
Member

String.format already uses HALF_UP rounding mode.

Also using NaN for an invalid value instead of throwing an exception which is difficult to expect users to work with.

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.

ValidatesRunner compliance status (on master branch)

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- Build Status 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
Build Status
Build Status
Build Status
Python --- Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status ---
XLang Build Status Build Status Build Status Build Status Build Status ---

Examples testing status on various runners

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

Post-Commit SDK/Transform Integration Tests Status (on master branch)

Go Java Python
Build Status 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 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.

@lukecwik
Copy link
Member Author

R: @ajamato @ihji

@lukecwik
Copy link
Member Author

Run Java PreCommit

@lukecwik
Copy link
Member Author

Run Java_Examples_Dataflow PreCommit

@lukecwik
Copy link
Member Author

Run Java_Examples_Dataflow_Java11 PreCommit

*/
private synchronized double getLinearInterpolation(double percentile) {
long totalNumOfRecords = getTotalCount();
if (totalNumOfRecords == 0) {
Copy link

Choose a reason for hiding this comment

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

Maybe this code shouldn't ever be called if totalNumOfRecords == 0
This feature is only used to print some info logging.
So ti could just print something else in this case

WDYT @ihji ?

private synchronized double getLinearInterpolation(double percentile) {
long totalNumOfRecords = getTotalCount();
if (totalNumOfRecords == 0) {
throw new RuntimeException("histogram has no record.");
Copy link

Choose a reason for hiding this comment

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

Just curious. Did you decide to make this change because you saw this exception thrown in a user pipeline? (Its possible the code is designed to not invoke this method in this case). Just wondering if actual pipelines are hitting this?

Or did you just decide to make this change to make to remove the exception, make the code safer, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

User pipelines were hitting this, b/189940287

@lukecwik
Copy link
Member Author

Run Java PreCommit

@lukecwik lukecwik merged commit f633c4f into apache:master Aug 17, 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