Skip to content

feat(iceberg): add IcebergBinaryRowWriter#366

Open
charlesdong1991 wants to merge 7 commits intoapache:mainfrom
charlesdong1991:iceberg-binary-row-writer
Open

feat(iceberg): add IcebergBinaryRowWriter#366
charlesdong1991 wants to merge 7 commits intoapache:mainfrom
charlesdong1991:iceberg-binary-row-writer

Conversation

@charlesdong1991
Copy link
Contributor

@charlesdong1991 charlesdong1991 commented Feb 22, 2026

Purpose

This PR implements IcebergBinaryRowWriter, efforts as part of #194

Tests

All tests are passed locally

Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY for the PR, left some comments.

///
/// [`CompactedRowWriter`]: crate::row::compacted::CompactedRowWriter
/// [`IcebergBucketingFunction`]: crate::bucketing::IcebergBucketingFunction
pub struct IcebergBinaryRowWriter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this PR also contain IcebergKeyEncoder? IcebergKeyEncoder implementation should be small, but the test cases there should provide a lot of value in verifying correctness of IcebergBinaryRowWriter.

See CompactedKeyEncoder implementation and test as example.

Copy link
Contributor Author

@charlesdong1991 charlesdong1991 Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, similar to previous comment, I notice IcebergKeyEncoder is being worked on in #308 .

So I can have a TODO to verify and add tests (since that key encoder is sort of consumer of row writer) after that PR is merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added a TODO comment in the function, and will address after 308

@charlesdong1991
Copy link
Contributor Author

charlesdong1991 commented Mar 15, 2026

Hi @leekeiabstraction @luoyuxia i wonder what's your view on this PR? For all dependencies on KeyEncoder part, i highlighted as TODO to address after it is implmeneted/merged. This PR has been hanging for a while, so i'd like to give it a push ^^

If it is fine, I am happy also to take over the IcebergKeyEncoder implementation to push it though if you prefer to have that merged first, as I'd like to test fluss/iceberg in python for demo.

Thanks again!

Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed on moving things along instead of blocking this PR. I've added an additional question. Once answered/addressed, we can approve/merge this PR and loop back to it once the blocking PR is merged.


impl BinaryWriter for IcebergBinaryRowWriter {
fn reset(&mut self) {
self.position = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think both buffer and to_bytes function only return [0..position], so i think stale bytes won't be included in output even we don't zero it IMHO @leekeiabstraction

But it's quite straightforward insurance if do it explicitly, let me then update it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks! PTAL @leekeiabstraction

Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TY for addressing the comments. Approved 🙌

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.

2 participants