Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refine doc for write support #999

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ZENOTME
Copy link
Contributor

@ZENOTME ZENOTME commented Feb 23, 2025

Part of #986. This PR adds more examples to refine the doc of writer.

@ZENOTME ZENOTME force-pushed the write_example branch 2 times, most recently from f817d1a to 67c1c5a Compare February 23, 2025 18:05
@ZENOTME
Copy link
Contributor Author

ZENOTME commented Feb 24, 2025

Feel free for any suggestion to make example better. cc @Xuanwo @liurenjie1024 @Fokko @kevinjqliu @xxchan @jonathanc-n

//!
//! ## Fast append data to table
//!
//! ```rust, no_run
Copy link
Member

Choose a reason for hiding this comment

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

This test only use memory file io and memory catalog, it should be able to run?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should create table here to make it run.

Copy link
Member

Choose a reason for hiding this comment

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

I personally believe it's more valuable. Is the blocker here that we don't support creating tables yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I will add it later.

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 find that the memory catalog can't update now. So we should merge #1002 first.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, @ZENOTME Thanks for this, but I don't think this is a good example of writing data since it involves too many low level api invocation. We should have a high level api to accept a stream of arrow record batches, and have the transaction, file writer hidden under the hood, just like what we did in table scan to convert table to an arrow batch stream. Or we could integrate with datafusion do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I hope we can have more high-level api examples. I think this is an example of low-level api which may be useful for computing engines integrated with iceberg-rust.🤔

Copy link
Contributor

@liurenjie1024 liurenjie1024 Feb 26, 2025

Choose a reason for hiding this comment

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

This is an example showing in crate front page, which I don't think is appropriate. If we actually want to tell compute engine how to integrate it, a better place would be to place it in website, which appears as an advanced tutorial.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an example showing in crate front page, which I don't think is appropriate.

Looks reasonable to me. What about also place it at https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/src/writer/mod.rs

//! .try_into()
//! .unwrap(),
//! );
//! let location_generator = DefaultLocationGenerator::new(table.metadata().clone()).unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

We are returning Result<()> here, how about using ? here for clean code?

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.

3 participants