Skip to content

Chore : In ClickHouseDisk read function , the line for getting info uses while loop for a single row, changed it to if statement for better clarity - #106203

Merged
thevar1able merged 1 commit into
ClickHouse:masterfrom
SaiRajeshRamaraju:read_fix
Jun 22, 2026
Merged

thevar1able merged 1 commit into
ClickHouse:masterfrom
SaiRajeshRamaraju:read_fix

Conversation

@SaiRajeshRamaraju

@SaiRajeshRamaraju SaiRajeshRamaraju commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

...

In the current rust file ClickHouse/rust/chcache/src/disks/clickhouse.rs :
image

According to query it only return a single row and even the lsp showing error the loop return after the first iteration. So for this it's better to use if condition rather than while since ,we only have one iteration / step for this.

Version info

  • Merged into: 26.6.1.1114

…changed from loop to if since it only return a single statement.
@CLAassistant

CLAassistant commented May 31, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@SaiRajeshRamaraju SaiRajeshRamaraju changed the title Chore : In ClickHouseDisk read function , the line for getting info … Chore : In ClickHouseDisk read function , the line for getting info uses while loop for a single row, changed it to if statement for better clarity Jun 1, 2026
@thevar1able thevar1able self-assigned this Jun 18, 2026
@thevar1able thevar1able added the can be tested Allows running workflows for external contributors label Jun 18, 2026

@thevar1able thevar1able left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the contribution!

@clickhouse-gh

clickhouse-gh Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1ab8ccf]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_tsan, parallel, 2/2) FAIL
01169_old_alter_partition_isolation_stress FAIL cidb IGNORED
BuzzHouse (arm_asan_ubsan) FAIL
AddressSanitizer: stack-use-after-scope (STID: 2518-4199) FAIL cidb IGNORED

AI Review

Summary

This PR changes ClickHouseDisk::read from a while let loop to an if let for reading the single row allowed by LIMIT 1. I found no behavioral issue in the code change; the remaining concern is PR metadata, because this is an internal cleanup rather than a user-facing Improvement.

PR Metadata
  • 💡 Changelog category should be Not for changelog (changelog entry is not required) instead of Improvement, because the PR only changes internal Rust control flow and does not alter user-visible behavior.
  • 💡 After changing the category, Changelog entry is not required. Suggested replacement:
### Changelog category (leave one):
- Not for changelog (changelog entry is not required)

### Changelog entry (a [user-readable short description](https://github.com/ClickHouse/ClickHouse/blob/master/docs/changelog_entry_guidelines.md) of the changes that goes into CHANGELOG.md):
...
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Jun 18, 2026
@thevar1able
thevar1able added this pull request to the merge queue Jun 22, 2026
Merged via the queue into ClickHouse:master with commit efc8896 Jun 22, 2026
163 of 166 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 22, 2026
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-improvement Pull request with some product improvements 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.

4 participants