Skip to content
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

Fix boundRatio incorrect merge #60532

Merged

Conversation

wangtZJU
Copy link
Contributor

@wangtZJU wangtZJU commented Feb 29, 2024

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix boundRatio incorrect merge

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

@alexey-milovidov
Copy link
Member

alexey-milovidov commented Feb 29, 2024

Missing tests. Missing comments. Missing a changelog entry.

@alexey-milovidov alexey-milovidov marked this pull request as draft February 29, 2024 08:07
@alexey-milovidov alexey-milovidov added the st-need-info We need extra data to continue (waiting for response) label Feb 29, 2024
@alexey-milovidov alexey-milovidov self-assigned this Feb 29, 2024
@wangtZJU
Copy link
Contributor Author

Hi @alexey-milovidov , the problem is that when other.empty = true, the original code will still use the other.left.x(which may be any arbitrary value) to update self's state.

I can reproduce it in a 2-nodes cluster,

-- this case mimic CI test 00715_bounding_ratio 
--
-- in node 1, run below queries
create table rate_test on cluster my_cluster (timestamp UInt32, event UInt32) engine=Memory;
insert into rate_test values (0,1000),(1,1001),(2,1002),(3,1003),(4,1004),(5,1005),(6,1006),(7,1007),(8,1008);
create table rate_test_dist (timestamp UInt32, event UInt32) engine=Distributed(my_cluster, currentDatabase(), 'rate_test');

select boundingRatio(timestamp, event) from rate_test;  -- output: 1
select boundingRatio(timestamp, event) from rate_test_dist; -- output: 126

but i don't know how to implement this in CI

@UnamedRus
Copy link
Contributor

Probably, even more "interesting" output
https://fiddle.clickhouse.com/f42759d4-6cbd-4a3d-9261-da6fe6e654a7

@alexey-milovidov
Copy link
Member

@wangtZJU, Write tests. Write comments. Write changelog entry.

@alexey-milovidov alexey-milovidov added the close in a month if not active This will be closed in case of no information label Mar 3, 2024
@wangtZJU
Copy link
Contributor Author

wangtZJU commented Mar 4, 2024

tests and changelog entry are added

@wangtZJU wangtZJU marked this pull request as ready for review March 4, 2024 14:24
@alexey-milovidov alexey-milovidov added can be tested Allows running workflows for external contributors and removed st-need-info We need extra data to continue (waiting for response) close in a month if not active This will be closed in case of no information labels Mar 5, 2024
@alexey-milovidov
Copy link
Member

Thank you!

@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-bugfix Pull request with bugfix, not backported by default label Mar 5, 2024
@robot-ch-test-poll4
Copy link
Contributor

robot-ch-test-poll4 commented Mar 5, 2024

This is an automated comment for commit c4062de with description of existing statuses. It's updated for the latest CI running

⏳ Click here to open a full report in a separate page

Check nameDescriptionStatus
CI runningA meta-check that indicates the running CI. Normally, it's in success or pending state. The failed status indicates some problems with the PR⏳ pending
Successful checks
Check nameDescriptionStatus
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Mergeable CheckChecks if all other necessary checks are successful✅ success
PR CheckThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success

@@ -63,6 +63,9 @@ struct AggregateFunctionBoundingRatioData
{
*this = other;
}
else if (other.empty)
{
Copy link
Member

Choose a reason for hiding this comment

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

It still lacks comments.


create table rate_test (timestamp UInt32, event UInt32) engine=Memory;
insert into rate_test values (0,1000),(1,1001),(2,1002),(3,1003),(4,1004),(5,1005),(6,1006),(7,1007),(8,1008);

select 1.0 = boundingRatio(timestamp, event) from rate_test;

create table rate_test2 (timestamp UInt32, event UInt32) engine=Memory;
Copy link
Member

Choose a reason for hiding this comment

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

It should be added as a new test. The old test should remain untouched.

@alexey-milovidov
Copy link
Member

@wangtZJU,

tests and changelog entry are added

But we also need comments in the code.
Writing code without comments is a crime.

@wangtZJU
Copy link
Contributor Author

wangtZJU commented Apr 8, 2024

@alexey-milovidov fixed

@clickhouse-ci clickhouse-ci bot added the manual approve Manual approve required to run CI label May 3, 2024
@CLAassistant
Copy link

CLAassistant commented May 3, 2024

CLA assistant check
All committers have signed the CLA.

@alexey-milovidov alexey-milovidov removed the manual approve Manual approve required to run CI label May 3, 2024
@alexey-milovidov alexey-milovidov added this pull request to the merge queue May 3, 2024
Merged via the queue into ClickHouse:master with commit 8408758 May 3, 2024
9 of 19 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 3, 2024
@wangtZJU wangtZJU deleted the fix_boundRatio_incorrect_merge branch May 5, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can be tested Allows running workflows for external contributors pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants