### Install Docker Desktop with Homebrew Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/container-runtimes.md Use Homebrew to install Docker Desktop on macOS. Ensure Docker Desktop is launched and configured before proceeding. ```shell brew install --cask docker ``` -------------------------------- ### Install uv Package Manager Source: https://github.com/apache/iceberg-rust/blob/main/bindings/python/README.md Installs the uv package manager version 0.9.3. This is a prerequisite for setting up the development environment. ```shell pip install uv==0.9.3 ``` -------------------------------- ### Install OrbStack with Homebrew Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/container-runtimes.md Install OrbStack, a Docker Desktop alternative for macOS, using Homebrew. This command installs the OrbStack application. ```shell brew install orbstack ``` -------------------------------- ### Install Rust Toolchain Source: https://github.com/apache/iceberg-rust/blob/main/CONTRIBUTING.md Use this command to install the Rust toolchain on Linux or macOS. Rustup will automatically configure the toolchain based on the project's rust-toolchain.toml file. ```shell curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Set Up Development Environment Source: https://github.com/apache/iceberg-rust/blob/main/bindings/python/README.md Configures the development environment for the project using the provided Makefile. This command should be run after installing necessary tools. ```shell make install ``` -------------------------------- ### Install cargo-deny Source: https://github.com/apache/iceberg-rust/blob/main/dev/release/README.md Install the cargo-deny tool, which is required for dependency license checks during the release candidate creation process. ```shell cargo install cargo-deny ``` -------------------------------- ### Verify Cargo Installation Source: https://github.com/apache/iceberg-rust/blob/main/CONTRIBUTING.md After installing Rust, verify that Cargo is correctly set up by running this command in the project's root directory. This ensures the toolchain is properly configured. ```shell $ cargo version cargo 1.69.0 (6e9a83356 2023-04-12) ``` -------------------------------- ### Initialize Catalog with OpenDAL Storage Source: https://github.com/apache/iceberg-rust/blob/main/crates/storage/opendal/README.md Demonstrates how to initialize a REST catalog builder with an `OpenDalStorageFactory` for S3 storage. This setup is used to interact with Iceberg tables. ```rust use std::collections::HashMap; use std::sync::Arc; use iceberg::{Catalog, CatalogBuilder, TableIdent}; use iceberg_catalog_rest::{RestCatalogBuilder, REST_CATALOG_PROP_URI}; use iceberg_storage_opendal::OpenDalStorageFactory; #[tokio::main] async fn main() -> iceberg::Result<()> { let catalog = RestCatalogBuilder::default() .with_storage_factory(Arc::new(OpenDalStorageFactory::S3 { customized_credential_load: None, })) .load( "my_catalog", HashMap::from([ (REST_CATALOG_PROP_URI.to_string(), "http://localhost:8181".to_string()), ]), ) .await?; let table = catalog .load_table(&TableIdent::from_strs(["my_namespace", "my_table"])?) .await?; let scan = table.scan().select_all().build()?; let stream = scan.to_arrow().await?; Ok(()) } ``` -------------------------------- ### Install GPG with apt Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/setup_gpg.md Installs the gnupg2 package on Debian-based systems. This is a prerequisite for managing GPG keys. ```shell sudo apt install gnupg2 ``` -------------------------------- ### Verify Docker Installation Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/container-runtimes.md Check if Docker and Docker Compose are installed and accessible by running their version commands. ```shell docker --version docker compose version ``` -------------------------------- ### Check Docker Compose Plugin Installation Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/container-runtimes.md Verify the installation of the Docker Compose plugin for Podman. This command checks the installed version of Docker Compose. ```shell $ docker compose version Docker Compose version v2.28.1 ``` -------------------------------- ### Install pyiceberg-core via PyPI Source: https://github.com/apache/iceberg-rust/blob/main/bindings/python/project-description.md Install the pyiceberg-rust powered core package using pip. This package is intended for use by pyiceberg. ```bash pip install pyiceberg-core ``` -------------------------------- ### Build and Test Python Bindings Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md Build and test the `pyiceberg-core` Python bindings. This involves navigating to the Python bindings directory, installing, and running tests. ```bash (cd bindings/python make install make test ) ``` -------------------------------- ### Build Iceberg Rust Website Source: https://github.com/apache/iceberg-rust/blob/main/website/README.md Run this command to build the Iceberg Rust website. It will automatically install mdbook if it's not already present. ```shell make site ``` -------------------------------- ### Check Podman Version Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/container-runtimes.md Verify that Podman version 4 or newer is installed. This is a prerequisite for setting up Podman as a container runtime. ```shell $ podman --version podman version 4.9.4-rhel ``` -------------------------------- ### Start Podman Socket Service Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/container-runtimes.md Start and check the status of the Podman socket service. This ensures that Podman is running and accessible via its socket. ```shell sudo systemctl start podman.socket sudo systemctl status podman.socket ``` -------------------------------- ### Create Release Candidate Tag and Artifacts Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md Use this script to create a release candidate tag and associated artifacts. It handles versioning, signing, and optional SVN uploads. Ensure you have the necessary permissions and environment setup. ```shell dev/release/create_rc.sh ${iceberg_version} ${rc} ``` ```shell dev/release/create_rc.sh 0.9.1 2 ``` ```shell dev/release/create_rc.sh ${iceberg_version} ${rc} --upload_svn 1 ``` -------------------------------- ### Add GPG Public Key to KEYS Document Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/setup_gpg.md Use SVN to checkout the release repository, append your GPG public key to the KEYS file, and commit the changes. Ensure SVN is installed and configured. ```shell svn co https://dist.apache.org/repos/dist/release/iceberg iceberg-dist # As this step will copy all the versions, it will take some time. If the network is broken, please use svn cleanup to delete the lock before re-execute it. cd iceberg-dist (gpg --list-sigs YOUR_NAME@apache.org && gpg --export --armor YOUR_NAME@apache.org) >> KEYS # Append your key to the KEYS file svn add . # It is not needed if the KEYS document exists before. svn ci -m "add gpg key for YOUR_NAME" # Later on, if you are asked to enter a username and password, just use your apache username and password. ``` -------------------------------- ### Upload Release Candidate Artifacts to SVN Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md Manually uploads release candidate artifacts to the SVN distribution directory. Ensure SVN is installed and configured. ```shell rc_dist_dir="apache-iceberg-rust-${iceberg_version}-rc${rc}" mkdir "/tmp/iceberg-dist-dev/${rc_dist_dir}/" cp "./dist/${rc_dist_dir}/"* "/tmp/iceberg-dist-dev/${rc_dist_dir}/" cd /tmp/iceberg-dist-dev/ svn status svn add "${rc_dist_dir}" svn commit -m "Prepare Apache Iceberg Rust ${iceberg_version} RC${rc}" ``` -------------------------------- ### Connect to Catalog and Load Table in Rust Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/README.md Demonstrates connecting to a memory catalog, loading a table, and building a scan. Ensure the `iceberg` crate is added as a dependency. ```rust use std::collections::HashMap; use std::sync::Arc; use futures::TryStreamExt; use iceberg::io::MemoryStorageFactory; use iceberg::memory::{MemoryCatalogBuilder, MEMORY_CATALOG_WAREHOUSE}; use iceberg::{Catalog, CatalogBuilder, Result, TableIdent}; #[tokio::main] async fn main() -> Result<()> { // Connect to a catalog with a memory storage factory. let catalog = MemoryCatalogBuilder::default() .with_storage_factory(Arc::new(MemoryStorageFactory)) .load( "my_catalog", HashMap::from([(MEMORY_CATALOG_WAREHOUSE.to_string(), "/tmp/warehouse".to_string())]), ) .await?; // Load table from catalog. let table = catalog .load_table(&TableIdent::from_strs(["hello", "world"])?) .await?; // Build table scan. let stream = table .scan() .select(["name", "id"]) .build()? .to_arrow() .await?; // Consume this stream like arrow record batch stream. let _data: Vec<_> = stream.try_collect().await?; Ok(()) } ``` -------------------------------- ### Import GPG Keys Source: https://github.com/apache/iceberg-rust/blob/main/website/src/download.md Import the KEYS file to your GPG keyring to verify release signatures. Ensure you have downloaded the KEYS file. ```shell gpg --import KEYS ``` -------------------------------- ### Initialize S3Tables Catalog in Rust Source: https://github.com/apache/iceberg-rust/blob/main/crates/catalog/s3tables/README.md Demonstrates how to initialize the S3Tables catalog using `S3TablesCatalogBuilder`. This is useful for setting up the catalog with a specific endpoint URL and bucket ARN. Ensure you have the necessary dependencies and tokio runtime configured. ```rust use std::collections::HashMap; use iceberg::CatalogBuilder; use iceberg_catalog_s3tables::{ S3TABLES_CATALOG_PROP_ENDPOINT_URL, S3TABLES_CATALOG_PROP_TABLE_BUCKET_ARN, S3TablesCatalogBuilder, }; #[tokio::main] async fn main() { let catalog = S3TablesCatalogBuilder::default() .with_endpoint_url("http://localhost:4566") .load( "s3tables", HashMap::from([ ( S3TABLES_CATALOG_PROP_TABLE_BUCKET_ARN.to_string(), "arn:aws:s3tables:us-east-1:123456789012:bucket/my-bucket".to_string(), ), ]), ) .await .unwrap(); // use `catalog` as any Iceberg Catalog } ``` -------------------------------- ### Verify Release Candidate Locally (Quick Check) Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md Skips expensive build steps during a quick local check by setting --build 0 and --python 0. ```shell dev/release/verify_rc.sh ${iceberg_version} ${rc} --download 0 --build 0 --python 0 ``` -------------------------------- ### Basic In-Memory FileIO Usage Source: https://github.com/apache/iceberg-rust/blob/main/docs/rfcs/0002_storage_trait.md Demonstrates creating and using an in-memory FileIO for testing purposes. This allows for writing and reading data without interacting with the actual file system. ```rust use iceberg::io::FileIO; // Create in-memory FileIO for testing let file_io = FileIO::new_with_memory(); // Write and read files let output = file_io.new_output("memory://test/file.txt")?; output.write("Hello, World!".into()).await?; let input = file_io.new_input("memory://test/file.txt")?; let content = input.read().await?; assert_eq!(content, bytes::Bytes::from("Hello, World!")); ``` -------------------------------- ### TableMetadata::history Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets a slice of the snapshot history. ```APIDOC ## TableMetadata::history ### Description Returns a slice containing the snapshot log, which details the history of snapshots for the table. ### Method Signature `pub fn history(&self) -> &[iceberg::spec::SnapshotLog]` ### Returns A slice of `SnapshotLog` entries. ``` -------------------------------- ### FileIO with OpenDAL S3 Factory Source: https://github.com/apache/iceberg-rust/blob/main/docs/rfcs/0002_storage_trait.md Shows how to configure and build a FileIO instance using the OpenDAL S3 storage factory. This is useful for interacting with S3 buckets for Iceberg table storage. ```rust use std::sync::Arc; use iceberg::io::FileIOBuilder; use iceberg_storage_opendal::OpenDalStorageFactory; // Create FileIO with explicit S3 factory let file_io = FileIOBuilder::new(Arc::new(OpenDalStorageFactory::S3)) .with_prop("s3.region", "us-east-1") .with_prop("s3.access-key-id", "my-access-key") .with_prop("s3.secret-access-key", "my-secret-key") .build()?; // Use the FileIO let input = file_io.new_input("s3://my-bucket/warehouse/table/metadata.json")?; let metadata = input.read().await?; ``` -------------------------------- ### TableMetadata::format_version Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets the format version of the table. ```APIDOC ## TableMetadata::format_version ### Description Retrieves the Iceberg format version used by this table metadata. ### Method Signature `pub fn format_version(&self) -> iceberg::spec::FormatVersion` ### Returns The `FormatVersion` enum value. ``` -------------------------------- ### TableMetadata::current_schema_id Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets the ID of the current schema. ```APIDOC ## TableMetadata::current_schema_id ### Description Retrieves the unique identifier (`SchemaId`) of the table's current schema. ### Method Signature `pub fn current_schema_id(&self) -> iceberg::spec::SchemaId` ### Returns The `SchemaId` of the current schema. ``` -------------------------------- ### Create RC with Custom Options Source: https://github.com/apache/iceberg-rust/blob/main/dev/release/README.md Demonstrates common options for the create_rc.sh script, such as specifying a release reference, disabling tag creation, or disabling signing. ```shell dev/release/create_rc.sh 0.9.1 2 --release_ref ``` ```shell dev/release/create_rc.sh 0.9.1 2 --create_rc_tag 0 --sign 0 ``` ```shell dev/release/create_rc.sh 0.9.1 2 --upload_svn 1 ``` ```shell dev/release/create_rc.sh 0.9.1 2 --check_headers 0 --check_deps 0 ``` -------------------------------- ### Get Namespace Source: https://github.com/apache/iceberg-rust/blob/main/crates/catalog/rest/public-api.txt Retrieves the details of a specific namespace. ```APIDOC ## GET /namespaces/{namespace} ### Description Retrieves the details of the specified namespace. ### Endpoint `/namespaces/{namespace}` ### Parameters #### Path Parameters - **namespace** (NamespaceIdent) - Required - The identifier of the namespace to retrieve. ``` -------------------------------- ### TableMetadata::default_sort_order_id Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets the ID of the default sort order. ```APIDOC ## TableMetadata::default_sort_order_id ### Description Retrieves the unique identifier (`i64`) of the table's default sort order. ### Method Signature `pub fn default_sort_order_id(&self) -> i64` ### Returns The `i64` ID of the default sort order. ``` -------------------------------- ### Promote Release with Custom Options Source: https://github.com/apache/iceberg-rust/blob/main/dev/release/README.md Demonstrates options for the release.sh script, such as disabling the creation of the final release tag or skipping the SVN artifact move. ```shell dev/release/release.sh 0.9.1 2 --create_release_tag 0 ``` ```shell dev/release/release.sh 0.9.1 2 --move_svn 0 ``` -------------------------------- ### Glue Catalog with S3 Storage Factory Source: https://github.com/apache/iceberg-rust/blob/main/docs/rfcs/0002_storage_trait.md Demonstrates configuring a Glue Catalog to use S3 for storage by injecting the OpenDAL S3 storage factory. This enables cloud storage for your Iceberg tables managed by Glue. ```rust use std::collections::HashMap; use std::sync::Arc; use iceberg::CatalogBuilder; use iceberg_catalog_glue::GlueCatalogBuilder; use iceberg_storage_opendal::OpenDalStorageFactory; // Inject S3 storage factory for cloud storage support let catalog = GlueCatalogBuilder::default() .with_storage_factory(Arc::new(OpenDalStorageFactory::S3)) .load("my_catalog", HashMap::from([ ("warehouse".to_string(), "s3://my-bucket/warehouse".to_string()), ("s3.region".to_string(), "us-east-1".to_string()), ])) .await?; // Load and scan a table - storage is handled automatically let table = catalog.load_table(&TableIdent::from_strs(["db", "my_table"])?)?.await?; let scan = table.scan()?.build()?; ``` -------------------------------- ### TableMetadata::default_sort_order Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets a reference to the default sort order. ```APIDOC ## TableMetadata::default_sort_order ### Description Retrieves a reference to the default `SortOrderRef` used for sorting data within the table. ### Method Signature `pub fn default_sort_order(&self) -> &iceberg::spec::SortOrderRef` ### Returns A reference to the default `SortOrderRef`. ``` -------------------------------- ### Verify a Release Candidate Source: https://github.com/apache/iceberg-rust/blob/main/dev/release/README.md Use this script to verify a release candidate by downloading artifacts, checking checksums and signatures, and running build and test suites. It can verify artifacts from a remote URL or a local directory. ```shell dev/release/verify_rc.sh 0.9.1 2 ``` ```shell dev/release/verify_rc.sh 0.9.1 2 --download 0 ``` -------------------------------- ### TableMetadata::default_partition_type Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets the default partition type as a StructType. ```APIDOC ## TableMetadata::default_partition_type ### Description Retrieves the default partition type, represented as a `StructType`. ### Method Signature `pub fn default_partition_type(&self) -> &iceberg::spec::StructType` ### Returns A reference to the default `StructType` representing the partition type. ``` -------------------------------- ### TableMetadata::default_partition_spec_id Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets the ID of the default partition specification. ```APIDOC ## TableMetadata::default_partition_spec_id ### Description Retrieves the unique identifier (`i32`) of the table's default partition specification. ### Method Signature `pub fn default_partition_spec_id(&self) -> i32` ### Returns The `i32` ID of the default partition specification. ``` -------------------------------- ### Build Project Source: https://github.com/apache/iceberg-rust/blob/main/bindings/python/README.md Compiles the project using the build command defined in the Makefile. This is typically done after making code changes or setting up the environment. ```shell make build ``` -------------------------------- ### TableMetadata::default_partition_spec Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets a reference to the default partition specification. ```APIDOC ## TableMetadata::default_partition_spec ### Description Retrieves a reference to the default `PartitionSpecRef` used for partitioning data in the table. ### Method Signature `pub fn default_partition_spec(&self) -> &iceberg::spec::PartitionSpecRef` ### Returns A reference to the default `PartitionSpecRef`. ``` -------------------------------- ### TableMetadata::current_snapshot_id Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets the optional ID of the current snapshot. ```APIDOC ## TableMetadata::current_snapshot_id ### Description Retrieves the optional identifier (`i64`) of the table's current snapshot. Returns `None` if there is no current snapshot. ### Method Signature `pub fn current_snapshot_id(&self) -> core::option::Option` ### Returns An `Option` containing the `i64` ID of the current snapshot, or `None`. ``` -------------------------------- ### TableMetadata::current_snapshot Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets an optional reference to the current snapshot. ```APIDOC ## TableMetadata::current_snapshot ### Description Retrieves an optional reference to the current `SnapshotRef` of the table. Returns `None` if there is no current snapshot. ### Method Signature `pub fn current_snapshot(&self) -> core::option::Option<&iceberg::spec::SnapshotRef>` ### Returns An `Option` containing a reference to the current `SnapshotRef`, or `None`. ``` -------------------------------- ### TableMetadata::current_schema Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Gets a reference to the current schema of the table. ```APIDOC ## TableMetadata::current_schema ### Description Retrieves a reference to the current `SchemaRef` associated with the table's metadata. ### Method Signature `pub fn current_schema(&self) -> &iceberg::spec::SchemaRef` ### Returns A reference to the current `SchemaRef`. ``` -------------------------------- ### project_with_partition Source: https://github.com/apache/iceberg-rust/blob/main/crates/integrations/datafusion/public-api.txt Creates a new execution plan that projects columns and partitions from an input plan. This is useful for optimizing queries that involve partition pruning. ```APIDOC ## fn project_with_partition ### Description Creates a new execution plan that projects columns and partitions from an input plan. This is useful for optimizing queries that involve partition pruning. ### Signature ```rust pub fn iceberg_datafusion::physical_plan::project_with_partition(input: alloc::sync::Arc, table: &iceberg::table::Table) -> datafusion_common::error::Result> ``` ``` -------------------------------- ### Transaction::new Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Creates a new `Transaction` instance associated with the given table. This is the starting point for performing transactional operations. ```APIDOC ## POST /transaction/new ### Description Creates a new `Transaction` instance associated with the given table. ### Method POST ### Endpoint /transaction/new ### Parameters #### Request Body - **table** (&iceberg::table::Table) - Required - The table to perform transactions on. ### Response #### Success Response (200) - **transaction** (iceberg::transaction::Transaction) - A new transaction instance. ``` -------------------------------- ### Verify Release Candidate Locally Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md Verifies the local release candidate artifacts. Use --download 0 to skip downloading artifacts. ```shell dev/release/verify_rc.sh ${iceberg_version} ${rc} --download 0 ``` -------------------------------- ### Create RestCatalog Instance Source: https://github.com/apache/iceberg-rust/blob/main/website/src/api.md Use this to create an instance of the RestCatalog. Ensure the necessary configurations are in place. ```rust use iceberg_rust::catalog::rest::RestCatalog; let catalog = RestCatalog::new(Default::default()).await.unwrap(); ``` -------------------------------- ### Implementing Custom Storage Backend Source: https://github.com/apache/iceberg-rust/blob/main/docs/rfcs/0002_storage_trait.md Provides a template for implementing a custom storage backend by defining a struct and implementing the `Storage` and `StorageFactory` traits. This is for advanced use cases requiring unique storage solutions. ```rust use std::sync::Arc; use async_trait::async_trait; use iceberg::io::{Storage, StorageFactory, StorageConfig, InputFile, OutputFile}; #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct MyCustomStorage { /* fields */ } #[async_trait] #[typetag::serde] impl Storage for MyCustomStorage { // Implement all required methods: exists, metadata, read, reader, // write, writer, delete, delete_prefix, new_input, new_output } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] pub struct MyCustomStorageFactory; #[typetag::serde] impl StorageFactory for MyCustomStorageFactory { fn build(&self, config: &StorageConfig) -> iceberg::Result> { Ok(Arc::new(MyCustomStorage { /* ... */ })) } } ``` -------------------------------- ### Create a Release Candidate Source: https://github.com/apache/iceberg-rust/blob/main/dev/release/README.md Use this script to create a source archive, detached signature, checksum, and signed tag for a release candidate. It performs license header checks and can optionally upload artifacts to SVN. ```shell dev/release/create_rc.sh 0.9.1 2 ``` -------------------------------- ### Manage Dependency Licenses Source: https://github.com/apache/iceberg-rust/blob/main/dev/release/README.md Use the dependency helper script to either generate or check the license lists for project dependencies. ```shell dev/release/dependencies.sh generate ``` ```shell dev/release/dependencies.sh check ``` -------------------------------- ### iceberg::table::StaticTable::scan Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Initiates a table scan operation, returning a builder for constructing a `TableScan`. This is the starting point for querying data within the table. ```APIDOC ## iceberg::table::StaticTable::scan ### Description Initiates a table scan operation, returning a builder for constructing a `TableScan`. This is the starting point for querying data within the table. ### Signature `pub fn scan(&self) -> iceberg::scan::TableScanBuilder<'_>` ### Returns A `iceberg::scan::TableScanBuilder` instance. ``` -------------------------------- ### MetadataTable Structure Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt A general structure for accessing various metadata tables of an Iceberg table. It provides methods to get specific metadata table views like manifests and snapshots. ```APIDOC ## Struct: iceberg::inspect::MetadataTable<'a> ### Description Represents a gateway to various metadata tables associated with an Iceberg table. ### Methods - **new(table: &'a iceberg::table::Table) -> Self** Creates a new `MetadataTable` instance for the given Iceberg table. - **manifests(&self) -> ManifestsTable<'_>** Returns a `ManifestsTable` view for accessing manifest data. - **snapshots(&self) -> SnapshotsTable<'_>** Returns a `SnapshotsTable` view for accessing snapshot data. ### Traits - **Debug**: Supports debugging output. ``` -------------------------------- ### Reference Creation and Predicates Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Demonstrates how to create a `Reference` to a column and apply various predicate operations to it. ```APIDOC ## Reference::new ### Description Creates a new `Reference` to a column with the given name. ### Method `Reference::new(name: impl Into) -> Self` ### Parameters - **name** (String) - The name of the column to reference. ## Reference::equal_to ### Description Creates an equality predicate. ### Method `Reference::equal_to(self, datum: Datum) -> Predicate` ### Parameters - **datum** (Datum) - The value to compare against. ## Reference::greater_than ### Description Creates a greater than predicate. ### Method `Reference::greater_than(self, datum: Datum) -> Predicate` ### Parameters - **datum** (Datum) - The value to compare against. ## Reference::greater_than_or_equal_to ### Description Creates a greater than or equal to predicate. ### Method `Reference::greater_than_or_equal_to(self, datum: Datum) -> Predicate` ### Parameters - **datum** (Datum) - The value to compare against. ## Reference::is_in ### Description Creates an `is in` predicate. ### Method `Reference::is_in(self, literals: impl IntoIterator) -> Predicate` ### Parameters - **literals** (Iterator of Datum) - The set of literals to check against. ## Reference::is_nan ### Description Creates an `is NaN` predicate. ### Method `Reference::is_nan(self) -> Predicate` ## Reference::is_not_in ### Description Creates a `is not in` predicate. ### Method `Reference::is_not_in(self, literals: impl IntoIterator) -> Predicate` ### Parameters - **literals** (Iterator of Datum) - The set of literals to check against. ## Reference::is_not_nan ### Description Creates an `is not NaN` predicate. ### Method `Reference::is_not_nan(self) -> Predicate` ## Reference::is_not_null ### Description Creates an `is not null` predicate. ### Method `Reference::is_not_null(self) -> Predicate` ## Reference::is_null ### Description Creates an `is null` predicate. ### Method `Reference::is_null(self) -> Predicate` ## Reference::less_than ### Description Creates a less than predicate. ### Method `Reference::less_than(self, datum: Datum) -> Predicate` ### Parameters - **datum** (Datum) - The value to compare against. ## Reference::less_than_or_equal_to ### Description Creates a less than or equal to predicate. ### Method `Reference::less_than_or_equal_to(self, datum: Datum) -> Predicate` ### Parameters - **datum** (Datum) - The value to compare against. ## Reference::not_equal_to ### Description Creates a not equal to predicate. ### Method `Reference::not_equal_to(self, datum: Datum) -> Predicate` ### Parameters - **datum** (Datum) - The value to compare against. ## Reference::not_starts_with ### Description Creates a `does not start with` predicate. ### Method `Reference::not_starts_with(self, datum: Datum) -> Predicate` ### Parameters - **datum** (Datum) - The value to compare against. ## Reference::starts_with ### Description Creates a `starts with` predicate. ### Method `Reference::starts_with(self, datum: Datum) -> Predicate` ### Parameters - **datum** (Datum) - The value to compare against. ## Reference::name ### Description Returns the name of the reference. ### Method `Reference::name(&self) -> &str` ## Reference::bind ### Description Binds the reference to a schema, resolving any ambiguities and preparing it for evaluation. ### Method `Reference::bind(&self, schema: SchemaRef, case_sensitive: bool) -> Result` ### Parameters - **schema** (SchemaRef) - The schema to bind against. - **case_sensitive** (bool) - Whether the binding should be case-sensitive. ### Response #### Success Response - **BoundReference** - The bound reference. ``` -------------------------------- ### Run Tests Source: https://github.com/apache/iceberg-rust/blob/main/bindings/python/README.md Executes the test suite for the project using the test command in the Makefile. This is crucial for verifying code correctness. ```shell make test ``` -------------------------------- ### TableMetadataBuilder::new Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Creates a new TableMetadataBuilder with initial table configuration. ```APIDOC ## TableMetadataBuilder::new ### Description Creates a new TableMetadataBuilder with initial table configuration. ### Signature ```rust pub fn new( schema: iceberg::spec::Schema, spec: impl core::convert::Into, sort_order: iceberg::spec::SortOrder, location: alloc::string::String, format_version: iceberg::spec::FormatVersion, properties: std::collections::hash::map::HashMap ) -> iceberg::Result ``` ### Parameters - `schema` (iceberg::spec::Schema) - The initial schema for the table. - `spec` (impl Into) - The initial partition specification. - `sort_order` (iceberg::spec::SortOrder) - The initial sort order. - `location` (alloc::string::String) - The table's location. - `format_version` (iceberg::spec::FormatVersion) - The table's format version. - `properties` (HashMap) - Initial table properties. ``` -------------------------------- ### Run Unit Tests Source: https://github.com/apache/iceberg-rust/blob/main/CONTRIBUTING.md Execute only the unit tests using this make command. This is useful for quickly verifying individual components without running integration tests. ```makefile make unit-test ``` -------------------------------- ### Create Docker Wrapper Script for Podman Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/container-runtimes.md Create a shell script at `/usr/bin/docker` to emulate the Docker CLI using Podman. This script redirects Docker commands to Podman. ```bash #!/bin/sh [ -e /etc/containers/nodocker ] || \ echo "Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg." >&2 exec sudo /usr/bin/podman "$@" ``` -------------------------------- ### Make Docker Wrapper Executable Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/container-runtimes.md Set execute permissions for the newly created `/usr/bin/docker` wrapper script. This allows the script to be run as a command. ```shell sudo chmod +x /usr/bin/docker ``` -------------------------------- ### GlueCatalogBuilder with StorageFactory - Rust Source: https://github.com/apache/iceberg-rust/blob/main/docs/rfcs/0002_storage_trait.md Catalog implementations store the optional StorageFactory and use it when provided. The `load` method demonstrates using the provided StorageFactory or falling back to `LocalFsStorageFactory`. ```rust pub struct GlueCatalogBuilder { config: GlueCatalogConfig, storage_factory: Option>, } impl CatalogBuilder for GlueCatalogBuilder { fn with_storage_factory(mut self, storage_factory: Arc) -> Self { self.storage_factory = Some(storage_factory); self } // In load(): // Use provided StorageFactory or LocalFsStorageFactory as fallback let factory = storage_factory.unwrap_or_else(|| Arc::new(LocalFsStorageFactory)); let file_io = FileIOBuilder::new(factory) .with_props(file_io_props) .build()?; } ``` -------------------------------- ### Create Table using RestCatalog Source: https://github.com/apache/iceberg-rust/blob/main/website/src/api.md Demonstrates how to create a new table within the catalog. This requires a schema and table identifier. ```rust use iceberg_rust::spec::TableSpec; let table = catalog.create_table("my_table", TableSpec::default()).await.unwrap(); ``` -------------------------------- ### Injecting Custom StorageFactory into Catalogs Source: https://github.com/apache/iceberg-rust/blob/main/docs/rfcs/0002_storage_trait.md Illustrates how to explicitly inject a custom StorageFactory, such as OpenDAL's S3 factory, into a catalog builder for advanced configuration. This allows for fine-grained control over storage settings. ```rust use std::collections::HashMap; use std::sync::Arc; use iceberg::CatalogBuilder; use iceberg::io::FileIOBuilder; use iceberg_catalog_glue::GlueCatalogBuilder; use iceberg_storage_opendal::OpenDalStorageFactory; // Create a custom StorageFactory let storage_factory = Arc::new(OpenDalStorageFactory::S3); // Inject StorageFactory into catalog let catalog = GlueCatalogBuilder::default() .with_storage_factory(storage_factory) .load("my_catalog", HashMap::from([ ("warehouse".to_string(), "s3://my-bucket/warehouse".to_string()), ("s3.region".to_string(), "us-east-1".to_string()), ])) .await?; ``` -------------------------------- ### Import Apache Iceberg GPG Keys Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md Manually import the Apache Iceberg release GPG keys from the official KEYS file. This is a prerequisite for verifying release signatures. ```bash curl https://downloads.apache.org/iceberg/KEYS -o KEYS gpg --import KEYS ``` -------------------------------- ### Promote RC with Release Script Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md Use the release script to promote a release candidate. Specify the version and RC number. Useful options include creating a release tag, moving artifacts to release distribution, and specifying SVN URLs. ```shell dev/release/release.sh ${iceberg_version} ${rc} ``` -------------------------------- ### Build and Test Rust Source Archive Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md Extract the source tarball and navigate into the extracted directory to build and test the Rust components of the release. ```bash tar -xzf apache-iceberg-rust-*.tar.gz cd apache-iceberg-rust-* make build && make test ``` -------------------------------- ### ManifestFile Methods Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Provides methods to check for the presence of added, deleted, or existing files and to load the manifest. ```APIDOC ## ManifestFile Methods ### Description Methods for interacting with `ManifestFile` objects, including checking file counts and loading the manifest content. ### Methods - `has_added_files()`: Checks if the manifest file has added files. - `has_deleted_files()`: Checks if the manifest file has deleted files. - `has_existing_files()`: Checks if the manifest file has existing files. - `load_manifest(file_io)`: Asynchronously loads the manifest content using the provided `FileIO`. - `clone()`: Creates a clone of the `ManifestFile`. - `eq(other)`: Compares this `ManifestFile` with another for equality. - `fmt()`: Formats the `ManifestFile` for debugging output. - `hash()`: Computes the hash of the `ManifestFile`. ``` -------------------------------- ### LocalFsStorage Methods Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Provides methods for interacting with the local file system for storage operations. ```APIDOC ## LocalFsStorage ### Description Methods for interacting with the local file system for storage operations. ### Methods - `read(path: &str)`: Reads the content of a file at the given path. - `reader(path: &str)`: Returns a file reader for the specified path. - `write(path: &str, bs: Bytes)`: Writes the provided bytes to the file at the given path. - `writer(path: &str)`: Returns a file writer for the specified path. ``` -------------------------------- ### iceberg::io::OssConfig Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Configuration for accessing Alibaba Cloud OSS. It includes fields for access keys, endpoint, and supports cloning, comparison, and conversion from storage configurations. ```APIDOC ## OssConfig Configuration for accessing Alibaba Cloud OSS. It includes fields for access keys, endpoint, and supports cloning, comparison, and conversion from storage configurations. ### Fields * **access_key_id**: Optional access key ID for OSS. * **access_key_secret**: Optional secret access key for OSS. * **endpoint**: Optional endpoint for OSS. ### Methods * **builder**: Creates a builder for OssConfig. * **clone**: Clones the OssConfig. * **eq**: Compares two OssConfig instances for equality. * **try_from**: Converts a StorageConfig into an OssConfig. * **default**: Returns the default OssConfig. * **fmt**: Formats the OssConfig for debugging. * **serialize**: Serializes the OssConfig. * **deserialize**: Deserializes the OssConfig. ``` -------------------------------- ### FileIOBuilder Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt A builder for constructing `FileIO` instances with custom configurations. ```APIDOC ## FileIOBuilder A builder for constructing `FileIO` instances with custom configurations. ### Methods - `new(factory)`: Creates a new `FileIOBuilder` with the specified storage factory. - `with_prop(key, value)`: Adds a single property to the builder's configuration. - `with_props(args)`: Adds multiple properties to the builder's configuration from an iterator. - `build()`: Constructs and returns a `FileIO` instance based on the current configuration. ``` -------------------------------- ### ManifestWriter::new Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Creates a new ManifestWriterBuilder for writing manifest files. ```APIDOC ## ManifestWriterBuilder::new ### Description Creates a new ManifestWriterBuilder for writing manifest files. ### Method `pub fn new(output: iceberg::io::OutputFile, snapshot_id: core::option::Option, key_metadata: core::option::Option>, schema: iceberg::spec::SchemaRef, partition_spec: iceberg::spec::PartitionSpec) -> Self` ### Parameters * `output`: The output file for the manifest. * `snapshot_id`: The ID of the snapshot this manifest belongs to. * `key_metadata`: Optional key metadata for encryption. * `schema`: The schema of the data in the manifest. * `partition_spec`: The partition specification for the data. ``` -------------------------------- ### Configure Podman Registries.conf Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/container-runtimes.md Add or modify the `/etc/containers/registries.conf` file to include `docker.io` as a registry location. This resolves short-name resolution errors for images. ```toml [[registry]] prefix = "docker.io" location = "docker.io" ``` -------------------------------- ### Upload GPG key to a public keyserver Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/setup_gpg.md Uploads your public GPG key to a specified keyserver using your key ID. Replace `` with your actual key identifier. ```shell gpg --keyserver keys.openpgp.org --send-key ``` -------------------------------- ### StorageFactory Build Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Builds a storage instance based on the provided configuration. ```APIDOC ## StorageFactory::build ### Description Builds a storage instance based on the provided configuration. ### Method `build(&self, config: &StorageConfig)` ### Parameters - **config** (`&StorageConfig`): The storage configuration to use for building the storage instance. ``` -------------------------------- ### Check Docker Socket Symlink for Podman Source: https://github.com/apache/iceberg-rust/blob/main/website/src/reference/container-runtimes.md Verify that the `/var/run/docker.sock` symlink points to the Podman socket. If it does not exist, create it manually. ```shell $ ls -al /var/run/docker.sock lrwxrwxrwx 1 root root 27 Jul 24 12:18 /var/run/docker.sock -> /var/run/podman/podman.sock ``` ```shell sudo ln -s /var/run/podman/podman.sock /var/run/docker.sock ``` -------------------------------- ### Check License Headers with Docker Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md Use a Docker container to check for correct license headers in the source code. This command mounts the current directory into the container for checking. ```bash docker run --rm -v $(pwd):/github/workspace apache/skywalking-eyes header check ``` -------------------------------- ### LocalFsStorageFactory::build Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Builds a new instance of LocalFsStorage based on the provided configuration. ```APIDOC ## POST /storage/local ### Description Builds a new instance of LocalFsStorage based on the provided configuration. ### Method POST ### Endpoint /storage/local ### Parameters #### Request Body - **config** (StorageConfig) - Required - The configuration for the storage. ### Response #### Success Response (200) - **storage** (Storage) - An instance of LocalFsStorage. ``` -------------------------------- ### Verify Release Candidate with GPG Key Import Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md This command extends the release verification script to import Apache Iceberg release keys into your local GPG keyring before signature verification. ```shell dev/release/verify_rc.sh ${iceberg_version} ${rc} --import_gpg_keys 1 ``` -------------------------------- ### MemoryKeyManagementClient Implementation Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt The `MemoryKeyManagementClient` provides a concrete implementation of the `KeyManagementClient` trait, suitable for in-memory testing or scenarios where external KMS is not required. ```APIDOC ## Struct: iceberg::encryption::kms::MemoryKeyManagementClient ### Description An in-memory implementation of the `KeyManagementClient` trait. ### Methods #### `generate_key` - **Description**: Generates a new encryption key in memory. - **Signature**: `generate_key(&self, _wrapping_key_id: &str) -> Pin> + Send + '_>>` #### `supports_key_generation` - **Description**: Indicates that this client supports key generation. - **Signature**: `supports_key_generation(&self) -> bool` #### `unwrap_key` - **Description**: Unwraps an encrypted key using in-memory operations. - **Signature**: `unwrap_key(&self, wrapped_key: &[u8], wrapping_key_id: &str) -> Pin> + Send + '_>>` #### `wrap_key` - **Description**: Wraps a key using in-memory operations. - **Signature**: `wrap_key(&self, key: &[u8], wrapping_key_id: &str) -> Pin>> + Send + '_>>` ``` -------------------------------- ### MemoryStorage::new Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Creates a new instance of MemoryStorage. ```APIDOC ## MemoryStorage::new ### Description Creates a new instance of `MemoryStorage` for in-memory file operations. ### Method `iceberg::io::MemoryStorage::new()` ### Parameters None ### Response - `Self` (iceberg::io::MemoryStorage) - A new instance of `MemoryStorage`. ``` -------------------------------- ### Checkout Iceberg SVN Repository Source: https://github.com/apache/iceberg-rust/blob/main/website/src/release.md Checks out the Iceberg SVN repository to a local directory for artifact management. ```shell svn co https://dist.apache.org/repos/dist/dev/iceberg/ /tmp/iceberg-dist-dev ``` -------------------------------- ### Verify RC with Custom Options Source: https://github.com/apache/iceberg-rust/blob/main/dev/release/README.md Shows common options for the verify_rc.sh script, such as disabling signature verification, importing GPG keys, or skipping build and test steps. ```shell dev/release/verify_rc.sh 0.9.1 2 --verify_signature 0 ``` ```shell dev/release/verify_rc.sh 0.9.1 2 --import_gpg_keys 1 ``` ```shell dev/release/verify_rc.sh 0.9.1 2 --build 0 --python 0 --check_headers 0 ``` -------------------------------- ### Datum Creation Methods Source: https://github.com/apache/iceberg-rust/blob/main/crates/iceberg/public-api.txt Provides methods for creating Datum instances from various primitive types and string representations. ```APIDOC ## Datum Creation Methods This section covers the methods available for constructing `iceberg::spec::Datum` instances. ### `Datum::double>(t: T) -> Self` Creates a Datum from a value that can be converted into an `f64`. ### `Datum::fixed>(input: I) -> Self` Creates a Datum from an iterator of bytes, typically used for fixed-size binary data. ### `Datum::float>(t: T) -> Self` Creates a Datum from a value that can be converted into an `f32`. ### `Datum::int>(t: T) -> Self` Creates a Datum from a value that can be converted into an `i32`. ### `Datum::long>(t: T) -> Self` Creates a Datum from a value that can be converted into an `i64`. ### `Datum::string(s: S) -> Self` Creates a Datum from a value that can be converted into a `String`. ### `Datum::time_from_hms_micro(hour: u32, min: u32, sec: u32, micro: u32) -> Result` Creates a Datum representing a time from hour, minute, second, and microsecond components. ### `Datum::time_from_str>(s: S) -> Result` Creates a Datum representing a time from a string slice. ### `Datum::time_micros(value: i64) -> Result` Creates a Datum representing a time from a 64-bit integer representing microseconds. ### `Datum::timestamp_from_datetime(dt: chrono::naive::datetime::NaiveDateTime) -> Self` Creates a Datum representing a timestamp from a `NaiveDateTime` object. ### `Datum::timestamp_from_str>(s: S) -> Result` Creates a Datum representing a timestamp from a string slice. ### `Datum::timestamp_micros(value: i64) -> Self` Creates a Datum representing a timestamp from a 64-bit integer representing microseconds. ### `Datum::timestamp_nanos(value: i64) -> Self` Creates a Datum representing a timestamp from a 64-bit integer representing nanoseconds. ### `Datum::timestamptz_from_datetime(dt: DateTime) -> Self` Creates a Datum representing a timezone-aware timestamp from a `DateTime` object. ### `Datum::timestamptz_from_str>(s: S) -> Result` Creates a Datum representing a timezone-aware timestamp from a string slice. ### `Datum::timestamptz_micros(value: i64) -> Self` Creates a Datum representing a timezone-aware timestamp from a 64-bit integer representing microseconds. ### `Datum::timestamptz_nanos(value: i64) -> Self` Creates a Datum representing a timezone-aware timestamp from a 64-bit integer representing nanoseconds. ### `Datum::uuid(uuid: uuid::Uuid) -> Self` Creates a Datum from a `uuid::Uuid` object. ### `Datum::uuid_from_str>(s: S) -> Result` Creates a Datum from a string slice representing a UUID. ```