Skip to content

Fix approx_top_k() to respect threshold parameter when called with si…#88867

Merged
yariks5s merged 1 commit intoClickHouse:masterfrom
raimannma:fix/top_k
Oct 23, 2025
Merged

Fix approx_top_k() to respect threshold parameter when called with si…#88867
yariks5s merged 1 commit intoClickHouse:masterfrom
raimannma:fix/top_k

Conversation

@raimannma
Copy link
Copy Markdown
Contributor

@raimannma raimannma commented Oct 21, 2025

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 into CHANGELOG.md):

Fix top_k to respect the threshold parameter when called with a single argument. Closes #88757

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Explaination

SELECT approx_top_k(50)(number) FROM numbers(200);

Previously this returned 30 rows now it returns 50 rows

Closes #88757

@raimannma
Copy link
Copy Markdown
Contributor Author

@UnamedRus Can you take a look at this PR? I think it's the exact change you described here.

@thevar1able thevar1able added the can be tested Allows running workflows for external contributors label Oct 21, 2025
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Oct 21, 2025

Workflow [PR], commit [a70ebf9]

Summary:

job_name test_name status info comment
Stateless tests (amd_asan, distributed plan, parallel, 2/2) failure
03047_on_fly_mutations_non_deterministic_replace FAIL cidb
Stateless tests (amd_ubsan, parallel) failure
00900_long_parquet_load FAIL cidb, flaky
Integration tests (amd_asan, old analyzer, 4/6) failure
test_scheduler_cpu_preemptive/test.py::test_downscaling[cpu-slot-preemption-timeout-1ms] FAIL cidb
OOM in dmesg FAIL cidb

@clickhouse-gh clickhouse-gh bot added the pr-bugfix Pull request with bugfix, not backported by default label Oct 22, 2025
@yariks5s yariks5s self-assigned this Oct 22, 2025
@yariks5s
Copy link
Copy Markdown
Member

00900_long_parquet_load - #88893

Integration tests (amd_asan, old analyzer, 4/6) - flaky

03047_on_fly_mutations_non_deterministic_replace - flaky

@yariks5s yariks5s added this pull request to the merge queue Oct 23, 2025
Merged via the queue into ClickHouse:master with commit 54d504a Oct 23, 2025
119 of 123 checks passed
@raimannma raimannma deleted the fix/top_k branch October 23, 2025 13:17
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 23, 2025
robot-ch-test-poll2 added a commit that referenced this pull request Oct 27, 2025
Cherry pick #88867 to 25.10: Fix approx_top_k() to respect threshold parameter when called with si…
robot-clickhouse added a commit that referenced this pull request Oct 27, 2025
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Oct 27, 2025
clickhouse-gh bot added a commit that referenced this pull request Oct 27, 2025
Backport #88867 to 25.10: Fix approx_top_k() to respect threshold parameter when called with si…
@robot-ch-test-poll4 robot-ch-test-poll4 added pr-backports-created-cloud deprecated label, NOOP pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR labels Oct 27, 2025
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-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-backports-created-cloud deprecated label, NOOP pr-bugfix Pull request with bugfix, not backported by default pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v25.10-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

approx_top_k() returns fixed 30 rows regardless of input N (for N>30)

7 participants