From 39add98a609be4c4a132c9e09be83240c746376d Mon Sep 17 00:00:00 2001 From: Ray Liu Date: Sun, 13 Jul 2025 16:03:04 +0800 Subject: [PATCH 1/5] Remove unnecessary ignore --- crates/iceberg/src/writer/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/iceberg/src/writer/mod.rs b/crates/iceberg/src/writer/mod.rs index 62b33e0b5f..bcf5effe02 100644 --- a/crates/iceberg/src/writer/mod.rs +++ b/crates/iceberg/src/writer/mod.rs @@ -38,7 +38,7 @@ //! own writer and implement writer trait for them so that the custom writer can integrate with existing writer. (See following example) //! //! # Simple example for the data file writer used parquet physical format: -//! ```rust, ignore +//! ```rust //! // This example uses `iceberg_catalog_memory`, which isn't enabled by default. //! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml. //! use std::sync::Arc; @@ -55,7 +55,7 @@ //! }; //! use iceberg::writer::{IcebergWriter, IcebergWriterBuilder}; //! use iceberg::{Catalog, Result, TableIdent}; -//! use crate::MemoryCatalog; +//! use iceberg::MemoryCatalog; //! use parquet::file::properties::WriterProperties; //! #[tokio::main] //! async fn main() -> Result<()> { @@ -97,7 +97,7 @@ //! ``` //! //! # Custom writer to record latency -//! ```rust, ignore +//! ```rust //! // This example uses `iceberg_catalog_memory`, which isn't enabled by default. //! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml. //! use std::time::Instant; @@ -112,7 +112,7 @@ //! }; //! use iceberg::writer::{IcebergWriter, IcebergWriterBuilder}; //! use iceberg::{Catalog, Result, TableIdent}; -//! use crate::MemoryCatalog; +//! use iceberg::MemoryCatalog; //! use parquet::file::properties::WriterProperties; //! //! #[derive(Clone)] From 82957fb5314338b47e0a42fe1abaa83db8b84e67 Mon Sep 17 00:00:00 2001 From: Ray Liu Date: Sun, 13 Jul 2025 16:06:22 +0800 Subject: [PATCH 2/5] Format --- crates/iceberg/src/writer/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/iceberg/src/writer/mod.rs b/crates/iceberg/src/writer/mod.rs index bcf5effe02..007b7ad68a 100644 --- a/crates/iceberg/src/writer/mod.rs +++ b/crates/iceberg/src/writer/mod.rs @@ -54,8 +54,7 @@ //! DefaultFileNameGenerator, DefaultLocationGenerator, //! }; //! use iceberg::writer::{IcebergWriter, IcebergWriterBuilder}; -//! use iceberg::{Catalog, Result, TableIdent}; -//! use iceberg::MemoryCatalog; +//! use iceberg::{Catalog, MemoryCatalog, Result, TableIdent}; //! use parquet::file::properties::WriterProperties; //! #[tokio::main] //! async fn main() -> Result<()> { @@ -111,8 +110,7 @@ //! DefaultFileNameGenerator, DefaultLocationGenerator, //! }; //! use iceberg::writer::{IcebergWriter, IcebergWriterBuilder}; -//! use iceberg::{Catalog, Result, TableIdent}; -//! use iceberg::MemoryCatalog; +//! use iceberg::{Catalog, MemoryCatalog, Result, TableIdent}; //! use parquet::file::properties::WriterProperties; //! //! #[derive(Clone)] From 41ff93d672030b88ed6cfd72bf49a420df12fec0 Mon Sep 17 00:00:00 2001 From: Ray Liu Date: Sun, 13 Jul 2025 19:23:59 +0800 Subject: [PATCH 3/5] Fix doc run --- crates/iceberg/src/writer/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/iceberg/src/writer/mod.rs b/crates/iceberg/src/writer/mod.rs index 007b7ad68a..bb597b3749 100644 --- a/crates/iceberg/src/writer/mod.rs +++ b/crates/iceberg/src/writer/mod.rs @@ -38,9 +38,7 @@ //! own writer and implement writer trait for them so that the custom writer can integrate with existing writer. (See following example) //! //! # Simple example for the data file writer used parquet physical format: -//! ```rust -//! // This example uses `iceberg_catalog_memory`, which isn't enabled by default. -//! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml. +//! ```rust, no_run //! use std::sync::Arc; //! //! use arrow_array::{ArrayRef, BooleanArray, Int32Array, RecordBatch, StringArray}; @@ -62,6 +60,8 @@ //! let file_io = FileIOBuilder::new("memory").build()?; //! // Connect to a catalog. //! let catalog = MemoryCatalog::new(file_io, None); +//! // Add customized code to create a table first. +//! //! // Load table from catalog. //! let table = catalog //! .load_table(&TableIdent::from_strs(["hello", "world"])?) @@ -96,9 +96,7 @@ //! ``` //! //! # Custom writer to record latency -//! ```rust -//! // This example uses `iceberg_catalog_memory`, which isn't enabled by default. -//! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml. +//! ```rust, no_run //! use std::time::Instant; //! //! use arrow_array::RecordBatch; @@ -162,9 +160,13 @@ //! #[tokio::main] //! async fn main() -> Result<()> { //! // Build your file IO. +//! use iceberg::NamespaceIdent; //! let file_io = FileIOBuilder::new("memory").build()?; //! // Connect to a catalog. //! let catalog = MemoryCatalog::new(file_io, None); +//! +//! // Add customized code to create a table first. +//! //! // Load table from catalog. //! let table = catalog //! .load_table(&TableIdent::from_strs(["hello", "world"])?) From 7f4f17c6c11d2cd6101749814464ef4e6982c2e3 Mon Sep 17 00:00:00 2001 From: liurenjie1024 Date: Mon, 14 Jul 2025 09:48:01 +0800 Subject: [PATCH 4/5] Fix lib.rs --- crates/iceberg/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/iceberg/src/lib.rs b/crates/iceberg/src/lib.rs index 49193be503..61782816d8 100644 --- a/crates/iceberg/src/lib.rs +++ b/crates/iceberg/src/lib.rs @@ -21,7 +21,7 @@ //! //! ## Scan A Table //! -//! ```rust, ignore +//! ```rust, no_run //! use futures::TryStreamExt; //! use iceberg::io::{FileIO, FileIOBuilder}; //! use iceberg::MemoryCatalog; From 4ecb5a98157621931e4f276afe03189bdabaadb5 Mon Sep 17 00:00:00 2001 From: liurenjie1024 Date: Mon, 14 Jul 2025 09:49:50 +0800 Subject: [PATCH 5/5] Format --- crates/iceberg/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/iceberg/src/lib.rs b/crates/iceberg/src/lib.rs index 61782816d8..612a5db601 100644 --- a/crates/iceberg/src/lib.rs +++ b/crates/iceberg/src/lib.rs @@ -24,8 +24,7 @@ //! ```rust, no_run //! use futures::TryStreamExt; //! use iceberg::io::{FileIO, FileIOBuilder}; -//! use iceberg::MemoryCatalog; -//! use iceberg::{Catalog, Result, TableIdent}; +//! use iceberg::{Catalog, MemoryCatalog, Result, TableIdent}; //! //! #[tokio::main] //! async fn main() -> Result<()> {