You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HIVE-30106: Iceberg: Column-stats ANALYZE spends most of its CPU on per-row reader plumbing - #6834
…er-row reader plumbing
- Skip scan-side basic stats when the storage handler supplies them itself (canProvideBasicStatistics(Table)), so the ANALYZE scan vectorizes
- Iceberg row-mode reads set PositionDeleteInfo and RowLineageInfo on the IOContext instead of round-tripping them through the Configuration per row
- MapredIcebergRecordReader.getPos() returns -1: a split is a group of file scan tasks, no offset maps to a file position
- Vectorized reads of a snapshot with equality deletes fall back to row mode (current snapshot, branch or tag)
deniskuzZ
changed the title
HIVE-30106: Iceberg: column-stats ANALYZE spends most of its CPU on per-row reader plumbing
HIVE-30106: Iceberg: Column-stats ANALYZE spends most of its CPU on per-row reader plumbing
Sep 30, 2026
…n; one Table per stats method
- HiveIcebergStorageHandler: vectorizationUnsupported and hasEqualityDeletes return the decision, disableVectorization acts on it; the read path checks both, the write path only the first
- BasicStatsNoJobTask: updatePartitions returns the table it wrote, and aggregateStats hands its parameters to the task's table, as BasicStatsTask does
When the Iceberg stats source is selected, this returns true even for a snapshot with equality deletes. The no-job collector then marks computeBasicStatistics() as accurate, but estimateNumRows() deliberately cannot subtract equality deletes and returns the total record count. Since this PR routes column ANALYZE through that no-job path, analyzing three records with one equality-deleted row publishes numRows=3 instead of the scan's exact value 2. Treat such snapshots as unable to provide basic statistics so the already row-mode scan gathers the exact count.
…once
- canUseBasicStats routes by storageHandlerOwnsBasicStats, TaskCompiler included
- metastore stats source: a plain ANALYZE scans instead of marking the commit-time row count accurate
- BasicStatsTask applies only an ANALYZE scan's count to handler-provided stats
- drop the unreachable partition check in HiveStorageHandlerStatCollector
- run the equality-delete CRUD tests vectorized
…er-row reader plumbing
- the Iceberg row-mode reader hands each row's position delete and row lineage info to the IOContext as objects,
instead of writing them into the Configuration and parsing them back for every row
- ANALYZE planning and basic stats of a storage-handler table: SemanticAnalyzer, TaskCompiler, BasicStatsNoJobTask
(PR apache#6834)
- Impact (cluster, 1TRC 1T-row column ANALYZE): before 110-140K rows/s/task with 10 of 12 threads in reader plumbing
(extrapolated 4.5-5 h, 40 x r5d); after 292.8 s (64 x r5d)
deniskuzZ
added a commit
to deniskuzZ/hive
that referenced
this pull request
Oct 12, 2026
…er-row reader plumbing
- the Iceberg row-mode reader hands each row's position delete and row lineage info to the IOContext as objects,
instead of writing them into the Configuration and parsing them back for every row
- ANALYZE planning and basic stats of a storage-handler table: SemanticAnalyzer, TaskCompiler, BasicStatsNoJobTask
(PR apache#6834)
- Impact (cluster, 1TRC 1T-row column ANALYZE): before 110-140K rows/s/task with 10 of 12 threads in reader plumbing
(extrapolated 4.5-5 h, 40 x r5d); after 292.8 s (64 x r5d)
…er-row reader plumbing
- the Iceberg row-mode reader hands each row's position delete and row lineage info to the IOContext as objects,
instead of writing them into the Configuration and parsing them back for every row
- ANALYZE planning and basic stats of a storage-handler table: SemanticAnalyzer, TaskCompiler, BasicStatsNoJobTask
- every ANALYZE routes by basic-stats ownership (canUseBasicStats via storageHandlerOwnsBasicStats, TaskCompiler
included); a plain ANALYZE scans instead of marking the commit-time row count accurate; BasicStatsTask applies only
an ANALYZE scan's count to handler-provided stats (iceberg_stats.q counted 5 rows for 3)
- vectorized reads of a snapshot with equality deletes fall back to row mode; the equality-delete CRUD tests run
vectorized
- (PR apache#6834)
deniskuzZ
added a commit
to deniskuzZ/hive
that referenced
this pull request
Oct 15, 2026
…er-row reader plumbing
- the Iceberg row-mode reader hands each row's position delete and row lineage info to the IOContext as objects,
instead of writing them into the Configuration and parsing them back for every row
- ANALYZE planning and basic stats of a storage-handler table: SemanticAnalyzer, TaskCompiler, BasicStatsNoJobTask
- every ANALYZE routes by basic-stats ownership (canUseBasicStats via storageHandlerOwnsBasicStats, TaskCompiler
included); a plain ANALYZE scans instead of marking the commit-time row count accurate; BasicStatsTask applies only
an ANALYZE scan's count to handler-provided stats (iceberg_stats.q counted 5 rows for 3)
- vectorized reads of a snapshot with equality deletes fall back to row mode; the equality-delete CRUD tests run
vectorized
- (PR apache#6834)
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Why are the changes needed?
Slow Iceberg: column-stats ANALYZE
Does this PR introduce any user-facing change?
No
How was this patch tested?