Skip to content

[lake/iceberg] Implement SupportsRecordBatchWrite for IcebergLakeWriter - #4048

Open
qzyu999 wants to merge 2 commits into
apache:mainfrom
qzyu999:lake/iceberg-arrow-batch-write
Open

[lake/iceberg] Implement SupportsRecordBatchWrite for IcebergLakeWriter#4048
qzyu999 wants to merge 2 commits into
apache:mainfrom
qzyu999:lake/iceberg-arrow-batch-write

Conversation

@qzyu999

@qzyu999 qzyu999 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements SupportsRecordBatchWrite for the Iceberg lake writer, enabling direct Arrow batch writing for append-only log tables during tiering. This closes the performance gap with Paimon's batch write path (landed in #3417/#3418).

Closes #4047

Changes

  • IcebergLakeWriter now implements SupportsRecordBatchWrite
  • New IcebergArrowBatchHelper reads Arrow FieldVector columns directly and produces Iceberg GenericRecord objects enriched with system columns (__bucket, __offset, __timestamp), then writes through the existing TaskWriter<Record> pipeline
  • Added arrow-vector and arrow-memory-netty as provided dependencies (same pattern as fluss-lake-paimon)
  • Only enabled for append-only tables (same restriction as Paimon)

Motivation

The Paimon lake writer implements SupportsRecordBatchWrite which takes raw Arrow batches from Fluss internal format and writes them to Parquet via paimon-arrow. The Iceberg path previously wrote row-by-row through GenericRecord objects wrapping LogRecord, requiring per-record binary deserialization.

With this change, the Iceberg tiering path can read directly from Arrow columnar memory, avoiding the LogRecord -> InternalRow -> FlussRecordAsIcebergRecord conversion chain for each record.

Design

The helper creates typed ArrowFieldExtractor lambdas per column based on the Fluss DataType, then iterates rows reading from the pre-fetched FieldVector array. This preserves the existing TaskWriter pipeline (file rolling, partition key generation, Iceberg metrics tracking) while eliminating the input-side deserialization cost.

Supported types: boolean, tinyint, smallint, int, bigint, float, double, string, char, binary, bytes, decimal, date, time, timestamp, timestamp_ltz. Complex types (array, map, row) have placeholder extractors and are left as follow-up work.

Test Plan

  • Compilation verified: mvn compile -pl fluss-lake/fluss-lake-iceberg -am -DskipTests
  • Formatting: mvn spotless:check passes
  • Checkstyle: mvn checkstyle:check passes
  • Existing tests: IcebergLakeCatalogTest, IcebergWriteResultSerializerTest, FlussToIcebergPredicateConverterTest, IcebergConfigurationTest all pass
  • Integration test coverage needed: a dedicated test writing ArrowRecordBatch through the new path (follow-up)

qzyu999 added 2 commits July 26, 2026 23:55
When s3.assumed.role.arn is configured in server.yaml without static
credentials, configure AssumedRoleCredentialProvider so that the
assumed role is actually used for S3 operations (remote log, KV
snapshots, lake offsets).

Previously, the code only logged a message and returned without
setting the credential provider, causing S3A to use ambient
credentials from the default chain instead of the configured role.

Closes apache#3761
Implements SupportsRecordBatchWrite for the Iceberg lake writer, enabling
direct Arrow batch writing for append-only tables. This avoids the per-record
LogRecord deserialization overhead by reading directly from Arrow columnar
vectors.

Changes:
- IcebergLakeWriter now implements SupportsRecordBatchWrite
- New IcebergArrowBatchHelper reads Arrow FieldVectors and produces
  GenericRecord objects enriched with system columns (__bucket, __offset,
  __timestamp), then writes through the existing TaskWriter pipeline
- Added arrow-vector and arrow-memory-netty as provided dependencies
- Only enabled for append-only tables (same restriction as Paimon)

Closes apache#4047
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[lake/iceberg] Implement SupportsRecordBatchWrite for IcebergLakeWriter

1 participant