[lake/iceberg] Implement SupportsRecordBatchWrite for IcebergLakeWriter - #4048
Open
qzyu999 wants to merge 2 commits into
Open
[lake/iceberg] Implement SupportsRecordBatchWrite for IcebergLakeWriter#4048qzyu999 wants to merge 2 commits into
qzyu999 wants to merge 2 commits into
Conversation
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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implements
SupportsRecordBatchWritefor 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
SupportsRecordBatchWriteFieldVectorcolumns directly and produces IcebergGenericRecordobjects enriched with system columns (__bucket,__offset,__timestamp), then writes through the existingTaskWriter<Record>pipelinearrow-vectorandarrow-memory-nettyas provided dependencies (same pattern asfluss-lake-paimon)Motivation
The Paimon lake writer implements
SupportsRecordBatchWritewhich takes raw Arrow batches from Fluss internal format and writes them to Parquet viapaimon-arrow. The Iceberg path previously wrote row-by-row throughGenericRecordobjects wrappingLogRecord, requiring per-record binary deserialization.With this change, the Iceberg tiering path can read directly from Arrow columnar memory, avoiding the
LogRecord->InternalRow->FlussRecordAsIcebergRecordconversion chain for each record.Design
The helper creates typed
ArrowFieldExtractorlambdas per column based on the FlussDataType, then iterates rows reading from the pre-fetchedFieldVectorarray. This preserves the existingTaskWriterpipeline (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
mvn compile -pl fluss-lake/fluss-lake-iceberg -am -DskipTestsmvn spotless:checkpassesmvn checkstyle:checkpassesIcebergLakeCatalogTest,IcebergWriteResultSerializerTest,FlussToIcebergPredicateConverterTest,IcebergConfigurationTestall passArrowRecordBatchthrough the new path (follow-up)