Menu

Integrations

Relevant source files

This document covers OpenDAL's integrations with other Rust ecosystem crates and frameworks. These integrations allow OpenDAL to work seamlessly with existing tools and libraries by providing compatibility adapters and bridges.

For information about OpenDAL's own applications and tools built on top of the core library, see Applications and Tools. For details about language bindings that expose OpenDAL to other programming languages, see Language Bindings.

Integration Overview

OpenDAL provides several integration packages that enable interoperability with popular Rust crates and frameworks. These integrations serve as adapter layers that translate between OpenDAL's internal APIs and the interfaces expected by external libraries.

Integration Architecture Overview

Sources: integrations/object_store/Cargo.toml1-62 integrations/parquet/Cargo.toml1-56

object_store Integration

The object_store_opendal crate is the primary integration that implements the widely-used object_store trait for OpenDAL. This allows any application that expects an object_store::ObjectStore implementation to use OpenDAL's 30+ storage services without modification.

Core Implementation

The integration centers around the OpendalStore struct that wraps an OpenDAL Operator and implements the ObjectStore trait:

OpendalStore Structure and Implementation

Sources: integrations/object_store/src/store.rs94-142 integrations/object_store/src/store.rs144-494

Type Conversion and Error Handling

The integration includes comprehensive type conversion utilities to translate between OpenDAL and object_store types:

OpenDAL Typeobject_store TypeConversion Function
opendal::Errorobject_store::Errorformat_object_store_error()
opendal::Metadataobject_store::ObjectMetaformat_object_meta()
opendal::ErrorKindobject_store::Error variantsPattern matching

The error conversion handles all OpenDAL error kinds and maps them to appropriate object_store error types:

Error Mapping Between OpenDAL and object_store

Sources: integrations/object_store/src/utils.rs30-54 integrations/object_store/src/utils.rs56-65

Advanced Features

Multipart Upload Support

The integration provides multipart upload capabilities through the OpendalMultipartUpload struct, which leverages OpenDAL's concurrent writer functionality:

Multipart Upload Flow

Sources: integrations/object_store/src/store.rs496-583

Conditional Operations

The integration supports advanced conditional operations including:

  • Version-based operations: Using ETags and version identifiers
  • Conditional reads: if-match, if-none-match, if-modified-since, if-unmodified-since
  • Conditional writes: if-not-exists, if-match for updates

Sources: integrations/object_store/src/store.rs220-324 integrations/object_store/src/store.rs146-189

Amazon S3 Builder Integration

For enhanced compatibility, the integration provides direct support for object_store's AmazonS3Builder:

Amazon S3 Builder Integration Flow

Sources: integrations/object_store/src/amazon_s3.rs24-78

Usage Examples

Basic Usage with DataFusion

The integration enables seamless use with DataFusion for SQL queries over object storage:

Sources: integrations/object_store/examples/datafusion.rs10-52 integrations/object_store/README.md104-157

WASM Support

The integration includes optional send_wrapper support for WebAssembly environments:

Sources: integrations/object_store/src/utils.rs23-28 integrations/object_store/src/utils.rs102-147 integrations/object_store/README.md160-167

Other Integrations

Parquet Integration

The parquet_opendal crate provides integration with the Parquet columnar storage format, enabling efficient reading and writing of Parquet files through OpenDAL's storage abstraction.

Parquet Integration Architecture

The integration focuses on async I/O operations optimized for cloud storage access patterns.

Sources: integrations/parquet/Cargo.toml18-48 integrations/parquet/examples/async_writer.rs1 integrations/parquet/examples/async_reader.rs1

Integration Testing Framework

All integrations include comprehensive behavior testing that validates compatibility across different storage services:

Integration Testing Architecture

Sources: integrations/object_store/tests/behavior/main.rs25-39 .github/workflows/test_behavior_integration_object_store.yml18-64 .github/scripts/test_behavior/test_plan.py63-72

The testing framework ensures that integrations work correctly across all supported storage services and maintain compatibility with their respective ecosystem libraries.