Repository navigation
Conversation
`ObjectIteratorSplitByBuckets` copied `ObjectInfo` by value, which dropped deletion vectors, position deletes, and equality deletes. `clone` keeps the derived object. Co-authored-by: Cursor <[email protected]>
`need_only_count` stays on for deletion vectors and position deletes and uses roaring range cardinality, while equality deletes still read real column values. Bucketed counts use only the assigned row groups and do not poison the file-level count cache. Co-authored-by: Cursor <[email protected]>
|
Workflow [PR], commit [0deefb0] Summary: ❌
AI ReviewSummaryThe PR preserves derived object metadata across bucket splits and enables Parquet metadata counts with bitmap deletes. Two issues remain: ordinary empty-column chunks can lose physical row mappings, and newly enabled count paths can materialize an entire row group into virtual columns. Missing context / blind spots
Findings❌ Blockers
Tests
Final Verdict❌ Block — preserve physical row mappings outside true count-only reads and bound count chunks before downstream materialization; add the focused regressions above. |
`IcebergStreamingPositionDeleteTransform` builds a dense filter per chunk, so a `need_only_count` row-group chunk allocates one filter of that length. Deletion vectors and `use_roaring_bitmap_iceberg_positional_deletes` still use `DeletionVectorTransform`, which resizes const count chunks from the bitmap. https: //github.com/ClickHouse/pull/122861 Co-authored-by: Cursor <[email protected]>
Build profile diff (arm_release)Commit See the job log for details. |
…t-info-clone Keep per-row-group `need_only_count` spans, loaded from `getFileFooter`. Count-from-files still uses `hasFilter` and skips bucketed reads and attached deletes. Co-authored-by: Cursor <[email protected]>
`ObjectInfoInArchive` now takes `archive_entry_index`. The merge left `clone` on the old constructor, so the tidy and fast-test builds failed. Both clones also keep `file_bucket_info_from_query_condition_cache`. https: //github.com/ClickHouse/pull/122861 https: //s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=122861&sha=05aaf6851a0036b42e9c219697e147b73f057ce2&name_0=PR&name_1=Build%20%28arm_tidy%2C%201%2F4%29 Co-authored-by: Cursor <[email protected]>
| if (!isColumnConst(*column)) | ||
| return false; | ||
| } | ||
| return true; |
There was a problem hiding this comment.
❌ Preserve row mappings for ordinary chunks with no columns
An empty column list also passes this check, but it does not imply need_only_count. For example, SELECT _row_number FROM icebergLocal(...) PREWHERE id >= 0 can remove id from the format's output header. When every row in a subgroup passes PREWHERE, ReadManager::read emits a chunk with no columns and no applied_filter. This branch then removes positional deletes by shrinking the row count, without recording which positions were removed.
For five rows starting at offset 100 with position 102 deleted, the surviving chunk has four rows and still has no filter, so VirtualColumnUtils produces _row_number = [100, 101, 102, 103] instead of [100, 101, 103, 104]. This affects deletion vectors and bitmap position deletes even with optimize_count_from_files = 0.
Please identify actual count-only chunks explicitly and retain the ordinary filtering/mapping path for other chunks, including empty-column chunks. Add a regression selecting _row_number through an all-pass PREWHERE over a file with positional deletes.
|
|
||
| reported_count = true; | ||
| const auto & row_group = need_only_count_row_groups[need_only_count_next++]; | ||
| auto chunk = getChunkForCount(row_group.num_rows); |
There was a problem hiding this comment.
Enabling this path for files with bitmap deletes changes their output from bounded Parquet subgroups to an entire row group per chunk. The bitmap transform is allocation-free, but downstream consumers are not: StorageObjectStorageSource::generate calls addRequestedFileLikeStorageVirtualsToChunk, which materializes virtual columns with convertToFullColumnIfConst.
Consequently, SELECT _path, _size, count() FROM icebergLocal(...) GROUP BY _path, _size over a file with a deletion vector now materializes _size as Nullable(UInt64) for every surviving row of the whole row group, plus the _path dictionary indexes. A row group with a hundred million rows needs roughly 900 MB for _size alone, whereas the previous decode path emitted subgroups bounded by input_format_parquet_max_block_size. Reducing that setting no longer bounds this allocation, so previously bounded queries can exceed their memory limit.
Please split metadata count spans into bounded chunks before any materializing transform, or restrict the large-chunk shortcut to pipelines that preserve constant/count-only chunks throughout. Cover a virtual-column count over a large row group with deletes under a constrained memory limit.
ObjectIteratorSplitByBucketspreviously slicedIcebergDataObjectInfotoObjectInfo, dropping equality and position deletes underBUCKETgranularity.The copy was
std::make_shared<ObjectInfo>(*object), so the derivedinfowas discarded. Cluster reads withcluster_table_function_buckets_batch_sizecould skip equality deletes, position deletes, and deletion vectors and return deleted rows.ObjectInfo::clonecopies polymorphically.IcebergDataObjectInfo::clonekeepsinfo(position deletes, the deletion vector, equality deletes, and partition columns),data_lake_metadata, androws_to_read.ObjectInfoInArchive::clonekeeps the archive reader, which the same slice would drop.count()over deletion vectors and position deletes now stays on the Parquetneed_only_countpath: footer and row-group metadata, plus roaring range cardinality, instead of decoding data pages. Equality deletes still disable that path, because their predicates need real column values. The count-from-files cache stays fail-closed whenever deletes are attached. Bucketedneed_only_countcounts only the assigned row groups and does not write a partial total into the file-level cache.This is the
clonefix and thecount()optimizations split out of #113561. Deletion-vector read support from that pull request landed separately in #110781.Related: #113561
Related: #110781
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Preserve Iceberg delete metadata when splitting files into buckets, and count deletion-vector and position-delete tables from Parquet row-group metadata. Copying
ObjectInfoby value dropped deletes, and a bucketedcount()previously used the whole file and could cache that partial total.Workflow [PR]
Sync PR [sync-upstream/pr/122861]