Skip to content

Iceberg bin pack compaction test - #7282

Draft
comphead wants to merge 2 commits into
apache:mainfrom
comphead:iceberg-compaction
Draft

comphead wants to merge 2 commits into
apache:mainfrom
comphead:iceberg-compaction

Conversation

@comphead

Copy link
Copy Markdown
Contributor

Experiment with Iceberg bin pack compaction test

A native Iceberg write over a native Iceberg scan ran two native plans per task. The scan's plan
exported its batches to the JVM over Arrow FFI, and the write's plan imported them again through an
FFI Scan and checked their strings as UTF-8 a second time.

A plain write over the scan, directly or through projections that only select its columns (Spark
adds one for INSERT INTO ... SELECT *), now takes the scan's native plan as its input.
CometIcebergWriteExec runs it with CometIcebergScanWriteRDD, which injects each partition's file
tasks the way CometExecRDD does for a scan inside any other native plan, and reports the scan's
metrics through the write's metric tree.

The scan's plan used to decode ahead on a Tokio task while the write ran on the Spark task thread.
To keep that overlap, IcebergWriteExec runs a native input on a Tokio task of its own behind a
channel of two batches, and execute_plan keeps such a write on the task thread.

CometIcebergCompactionBenchmark times Iceberg's rewrite_data_files, whose file group rewrites take
this path, under stock Spark and with Comet's native scan and writer.
…native plan

The rewrite plans that CometIcebergRewriteActionSuite captures have the same nodes whether the
native write runs the scan of its file group in its own native plan or reads the scan's batches over
FFI. The suite now also records the RDDs of each execution's jobs, and asserts that the bin-pack
rewrites, with and without delete files, run CometIcebergScanWriteRDD, and that the sort and zOrder
rewrites, which have a sort between the scan and the write, do not.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Iceberg area:writer Native Parquet writer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant