Skip to content

Revert "Parallelize reads from a single Parquet file in StorageFile" - #104359

Merged
alexey-milovidov merged 1 commit into
masterfrom
revert-104251-parquet-single-file-parallelism
May 8, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
revert-104251-parquet-single-file-parallelism

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented May 8, 2026 •

Copy link
Copy Markdown
Member

Reverts #104251

After further testing it appears that short queries degrade.

Version info

  • Merged into: 26.5.1.461

@clickhouse-gh

clickhouse-gh Bot commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c09bbde]

Summary: ✅


AI Review

Summary

This PR reverts single-file Parquet parallelism in StorageFile, but it also reverts bucket-aware need_only_count logic in the shared Parquet input format. That introduces a correctness regression for existing bucketed Parquet reads in object storage paths. Verdict: request changes.

PR Metadata

⚠️ The PR body does not follow .github/PULL_REQUEST_TEMPLATE.md: Changelog category, Changelog entry, and documentation checkbox are missing.

Suggested replacement text:

### Changelog category (leave one):
- CI Fix or Improvement

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

### Documentation entry for user-facing changes
- [ ] Documentation is written (mandatory for new features)
Findings

❌ Blockers

  • [src/Processors/Formats/Impl/ParquetV3BlockInputFormat.cpp:136] In need_only_count mode, the code now always returns file_metadata.num_rows, ignoring buckets_to_read. Existing object-storage reads still call setBucketsToRead for bucketed Parquet objects, so each bucket source reports full-file rows and count() is overcounted (roughly multiplied by bucket count).
    • Suggested fix: keep bucket-aware counting in this method (sum only row groups from buckets_to_read->row_group_ids) while reverting only StorageFile single-file parallelization.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ❌ Reintroduces incorrect count() behavior for existing bucketed object-storage Parquet reads.
SettingsChangesHistory.cpp ➖
PR metadata quality ⚠️ PR template fields are missing.
Safe rollout ⚠️ Revert is not isolated to StorageFile; shared Parquet counting behavior regresses.
Compilation time ✅
No large/binary files ✅
Final Verdict

Status: ⚠️ Request changes

Minimum required actions:

  1. Restore bucket-aware need_only_count handling in ParquetV3BlockInputFormat::read for the setBucketsToRead path.
  2. Fill PR template metadata (Changelog category, Changelog entry, documentation checkbox).

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 8, 2026
}

auto chunk = getChunkForCount(num_rows);
auto chunk = getChunkForCount(size_t(file_metadata.num_rows));

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.

This reintroduces a correctness issue for existing bucketed Parquet reads outside StorageFile: StorageObjectStorageSource still calls setBucketsToRead (see src/Storages/ObjectStorage/StorageObjectStorageSource.cpp, line 842), so in need_only_count mode each bucket source now reports the full file_metadata.num_rows.

For a single Parquet object split into N buckets, SELECT count() becomes approximately N times too large.

Could we keep the bucket-aware counting logic here (sum only buckets_to_read->row_group_ids) while reverting only the StorageFile single-file parallelization?

pull Bot pushed a commit to Haofei/ClickHouse that referenced this pull request May 8, 2026
The AI review skill flagged revert PRs for not following
`.github/PULL_REQUEST_TEMPLATE.md`, but revert PRs are allowed to omit
`Changelog category`, `Changelog entry`, and the documentation checkbox
- their body is typically just a `Reverts ...` link with a brief reason.

The review skill now detects revert PRs (by `Revert "..."` title,
`Reverts ClickHouse/ClickHouse#N`, or `This reverts commit <sha>`) and
skips template metadata validation for them.

Example of an incorrect finding fixed by this change:
ClickHouse#104359 (comment)

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

The correctness issue should be fixed independently, after the revert.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

This should prevent the regression: #104368

@clickhouse-gh

clickhouse-gh Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.20% 84.10% -0.10%
Functions 91.10% 91.10% +0.00%
Branches 76.70% 76.60% -0.10%

Changed lines: 91.49% (43/47) | lost baseline coverage: 15 line(s) · Uncovered code

Full report · Diff report

@alexey-milovidov alexey-milovidov self-assigned this May 8, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue May 8, 2026
Merged via the queue into master with commit b7cfa2d May 8, 2026
165 checks passed
@alexey-milovidov
alexey-milovidov deleted the revert-104251-parquet-single-file-parallelism branch May 8, 2026 21:13
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 8, 2026
@Algunenano Algunenano added the post-approved Approved, but after the PR is merged. label May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

post-approved Approved, but after the PR is merged. pr-not-for-changelog This PR should not be mentioned in the changelog 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.

3 participants