镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

HIVE-30109: Iceberg: apply position deletes per batch - #6922

Draft
deniskuzZ wants to merge 6 commits into
apache:masterfrom
deniskuzZ:HIVE-30109
Draft

deniskuzZ wants to merge 6 commits into
apache:masterfrom
deniskuzZ:HIVE-30109

Conversation

@deniskuzZ

@deniskuzZ deniskuzZ commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

  • HiveDeleteFilter applies a data file's PositionDeleteIndex to a whole batch: it marks the deleted rows in the batch's position range and drops them from the selected rows
  • Removes the per-row path through Iceberg's DeleteFilter (HiveRow, HiveStructLike, HiveValueConverter, the IS_DELETED column)
  • Equality deletes are still rejected on the vectorized path, as before; row mode still reads them
  • Stacked on HIVE-30108

Why are the changes needed?

Optimization. Local: 19.0 -> 1.32 ns/row at 7% scattered deletes (a local measurement of the delete filter; the harness is not part of this PR). Cluster, 1TRC part2 V2, 40 x r5d: these figures combine this PR with HIVE-30108 (and its cheaper delete-cache miss path): delete overhead 179.0 -> 29.4 s, part2 394.3 -> 263.1 s

Does this PR introduce any user-facing change?

No

How was this patch tested?

  • TestHiveDeleteFilter: random and ranged deletes, incoming selections, positions beyond the int range, an unknown row position
  • TestHiveIcebergVectorization now also runs V3, and the filtered-block test runs on ORC as well as Parquet; testRowIterator was removed with the per-row path
  • TestCachingDeleteLoader, TestHiveVectorizedReader, TestHiveIcebergCRUD#testPositionDeleteWithOrcRowFiltering
  • llap_iceberg_read_orc_deletes.q, llap_iceberg_read_orc.q, llap_iceberg_delete_cache.q (TestIcebergLlapLocalCliDriver)

… deletes

- LLAP reports the file row of the first row of each batch: ORC files with position deletes or virtual columns read through LLAP IO
- The non-LLAP vectorized ORC reader forces orc.sarg.to.filter off: the row-level filter drops rows and whole batches without reporting their positions; the SARG still prunes stripes and row groups (HIVE-30110)
- Impact: correctness/routing; ORC files with deletes now read through LLAP IO (not timed)
- llap_iceberg_read_orc_deletes.q: V2 position deletes and V3 deletion vectors on an ORC file with three row groups,
  read through LLAP IO (LLAP IO counters in the golden)
- The row-mode ORC reader forces orc.sarg.to.filter off too: Iceberg's OrcIterable takes the batch's file position
  before ORC can skip filtered batches
- LlapRecordReader.getRowNumber returns Long.MIN_VALUE (unknown) instead of throwing
- OrcEncodedDataConsumer: drop the redundant noIndex check
- TestOrcEncodedDataConsumerRowPositions: drop redundant tests and asserts; a read without columns replaces the faked
  ALL_RGS case
- HiveVectorizedReader comments
…tadata cache

- Impact (cluster, 1TRC part2 V2, 40 x r5d): 711.9 s without the cache vs 394.3 s with it; hit rate 81-84%;
  local miss-path decode 235 -> 20 ns per record
- Compare hive.llap.io.cache.deletes case-insensitively, as HiveConf validates it (CachingDeleteLoader and the ACID
  reader)
- The best-effort metadata cache put no longer waits for memory: it evicts while that frees memory, then fails; the
  cache tag is computed inside the best-effort block
- TestCachingDeleteLoader: NONE level; the put that cannot reserve memory returns without an interrupt; drop the
  duplicated DV counters test and a duplicated assert
- Impact (local): 19.0 -> 1.32 ns/row; cluster (1TRC part2 V2, 40 x r5d, together with a cheaper delete-cache miss
  path): delete overhead 179.0 -> 29.4 s, part2 394.3 -> 263.1 s
- HiveVectorizedReader.reader: drop the unused readSchema parameter and the equality deletes TODO
- HiveDeleteFilter: drop the empty-batch guard (HiveBatchIterator ends the scan at an empty batch)
- TestHiveDeleteFilter: drop the loader tests, which TestCachingDeleteLoader covers
- testHiveDeleteFilterWithOrcRowFiltering runs on every format version
- DeletionVectors: keep the HIVE-30108 javadoc
@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