|
38 | 38 | //! own writer and implement writer trait for them so that the custom writer can integrate with existing writer. (See following example)
|
39 | 39 | //!
|
40 | 40 | //! # Simple example for the data file writer used parquet physical format:
|
41 |
| -//! ```rust, ignore |
42 |
| -//! // This example uses `iceberg_catalog_memory`, which isn't enabled by default. |
43 |
| -//! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml. |
| 41 | +//! ```rust, no_run |
44 | 42 | //! use std::sync::Arc;
|
45 | 43 | //!
|
46 | 44 | //! use arrow_array::{ArrayRef, BooleanArray, Int32Array, RecordBatch, StringArray};
|
|
54 | 52 | //! DefaultFileNameGenerator, DefaultLocationGenerator,
|
55 | 53 | //! };
|
56 | 54 | //! use iceberg::writer::{IcebergWriter, IcebergWriterBuilder};
|
57 |
| -//! use iceberg::{Catalog, Result, TableIdent}; |
58 |
| -//! use crate::MemoryCatalog; |
| 55 | +//! use iceberg::{Catalog, MemoryCatalog, Result, TableIdent}; |
59 | 56 | //! use parquet::file::properties::WriterProperties;
|
60 | 57 | //! #[tokio::main]
|
61 | 58 | //! async fn main() -> Result<()> {
|
62 | 59 | //! // Build your file IO.
|
63 | 60 | //! let file_io = FileIOBuilder::new("memory").build()?;
|
64 | 61 | //! // Connect to a catalog.
|
65 | 62 | //! let catalog = MemoryCatalog::new(file_io, None);
|
| 63 | +//! // Add customized code to create a table first. |
| 64 | +//! |
66 | 65 | //! // Load table from catalog.
|
67 | 66 | //! let table = catalog
|
68 | 67 | //! .load_table(&TableIdent::from_strs(["hello", "world"])?)
|
|
97 | 96 | //! ```
|
98 | 97 | //!
|
99 | 98 | //! # Custom writer to record latency
|
100 |
| -//! ```rust, ignore |
101 |
| -//! // This example uses `iceberg_catalog_memory`, which isn't enabled by default. |
102 |
| -//! // To run this, add `iceberg-catalog-memory` as a dependency in your Cargo.toml. |
| 99 | +//! ```rust, no_run |
103 | 100 | //! use std::time::Instant;
|
104 | 101 | //!
|
105 | 102 | //! use arrow_array::RecordBatch;
|
|
111 | 108 | //! DefaultFileNameGenerator, DefaultLocationGenerator,
|
112 | 109 | //! };
|
113 | 110 | //! use iceberg::writer::{IcebergWriter, IcebergWriterBuilder};
|
114 |
| -//! use iceberg::{Catalog, Result, TableIdent}; |
115 |
| -//! use crate::MemoryCatalog; |
| 111 | +//! use iceberg::{Catalog, MemoryCatalog, Result, TableIdent}; |
116 | 112 | //! use parquet::file::properties::WriterProperties;
|
117 | 113 | //!
|
118 | 114 | //! #[derive(Clone)]
|
|
164 | 160 | //! #[tokio::main]
|
165 | 161 | //! async fn main() -> Result<()> {
|
166 | 162 | //! // Build your file IO.
|
| 163 | +//! use iceberg::NamespaceIdent; |
167 | 164 | //! let file_io = FileIOBuilder::new("memory").build()?;
|
168 | 165 | //! // Connect to a catalog.
|
169 | 166 | //! let catalog = MemoryCatalog::new(file_io, None);
|
| 167 | +//! |
| 168 | +//! // Add customized code to create a table first. |
| 169 | +//! |
170 | 170 | //! // Load table from catalog.
|
171 | 171 | //! let table = catalog
|
172 | 172 | //! .load_table(&TableIdent::from_strs(["hello", "world"])?)
|
|
0 commit comments