diff --git a/crates/examples/src/rest_catalog_namespace.rs b/crates/examples/src/rest_catalog_namespace.rs index 0a508a7d8..99aaf2e64 100644 --- a/crates/examples/src/rest_catalog_namespace.rs +++ b/crates/examples/src/rest_catalog_namespace.rs @@ -20,12 +20,17 @@ use std::collections::HashMap; use iceberg::{Catalog, NamespaceIdent}; use iceberg_catalog_rest::{RestCatalog, RestCatalogConfig}; +/// It a simple example that demonstrates how to create a namespace in a REST catalog. +/// It requires a running instance of the iceberg-rest catalog for the port 8181. +/// You can find how to run the iceberg-rest catalog in the official documentation. +/// +/// [Quickstart](https://iceberg.apache.org/spark-quickstart/) #[tokio::main] async fn main() { // ANCHOR: create_catalog // Create catalog let config = RestCatalogConfig::builder() - .uri("http://localhost:8080".to_string()) + .uri("http://localhost:8181".to_string()) .build(); let catalog = RestCatalog::new(config); diff --git a/crates/examples/src/rest_catalog_table.rs b/crates/examples/src/rest_catalog_table.rs index a0a672f15..17455915f 100644 --- a/crates/examples/src/rest_catalog_table.rs +++ b/crates/examples/src/rest_catalog_table.rs @@ -21,11 +21,16 @@ use iceberg::spec::{NestedField, PrimitiveType, Schema, Type}; use iceberg::{Catalog, TableCreation, TableIdent}; use iceberg_catalog_rest::{RestCatalog, RestCatalogConfig}; +/// This is a simple example that demonstrates how to create a table in a REST catalog and get it back. +/// It requires a running instance of the iceberg-rest catalog for the port 8080. +/// You can find how to run the iceberg-rest catalog in the official documentation. +/// +/// [Quickstart](https://iceberg.apache.org/spark-quickstart/) #[tokio::main] async fn main() { // Create catalog let config = RestCatalogConfig::builder() - .uri("http://localhost:8080".to_string()) + .uri("http://localhost:8181".to_string()) .build(); let catalog = RestCatalog::new(config); @@ -60,10 +65,10 @@ async fn main() { // ANCHOR_END: create_table // ANCHOR: load_table - let table2 = catalog - .load_table(&TableIdent::from_strs(["default", "t2"]).unwrap()) + let table_created = catalog + .load_table(&TableIdent::from_strs(["default", "t1"]).unwrap()) .await .unwrap(); - println!("{:?}", table2.metadata()); + println!("{:?}", table_created.metadata()); // ANCHOR_END: load_table }