Skip to content

HIVE-30275: Iceberg: Splits serialize the column stats of multi-file delete files, which tasks never read - #6975

Open
deniskuzZ wants to merge 1 commit into
apache:masterfrom
deniskuzZ:HIVE-30275
Open

deniskuzZ wants to merge 1 commit into
apache:masterfrom
deniskuzZ:HIVE-30275

Conversation

@deniskuzZ

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

IcebergSplit.write serializes the delete files that are not file-scoped without their column stats
(DeleteFile.copyWithoutStats()). A file-scoped position delete is written unchanged: its file_path bounds name the
data file it belongs to (ContentFileUtil.referencedDataFile). A deletion vector is written unchanged too.

Why are the changes needed?

Every split carries the delete files of its data files with their column stats. Iceberg's planner already reduces
them to the stats of the file_path column, but a task reads none of them: delete readers apply the deletes without
looking at stats, and the only task-side use is ContentFileUtil.referencedDataFile for file-scoped deletes, which
this change keeps. For multi-file (for example partition-scoped) position deletes and equality deletes, the stats
are a third to two thirds of the serialized bytes and about two thirds of the serialization time.

Measured locally per split (4,000 splits of a table with partition-scoped V2 position deletes, 300-320 deletes per
split, Java serialization plus the Snappy compression of HIVE-30271, single thread, copies of the deletes included):

deletes serialization, before / after Java bytes, before / after Snappy bytes, before / after
without file_path bounds 737 / 244 us 172.5 / 116.2 KB 18.4 / 12.7 KB
with file_path range bounds 778 / 240 us 316.0 / 109.3 KB 26.1 / 12.1 KB

Tables whose deletes are all file-scoped position deletes or deletion vectors serialize the same bytes as before.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

  • TestIcebergSplit: a split round trip drops the stats of a multi-file position delete and keeps a file-scoped
    delete's referenced data file, a DV's referenced data file and content range, and the data file's stats.
  • TestInputFormatReaderDeletes, TestIcebergInputFormats, TestHiveIcebergCRUD, TestHiveIcebergDeletionVectors
    and TestHiveIcebergTimeTravel pass.

…delete files, which tasks never read

- IcebergSplit.write drops the column stats of delete files that are not file-scoped
- Test: a split round trip drops multi-file delete stats, keeps file-scoped and DV references and data file stats
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants