Repository navigation
docs(avro): add OpenDAL read and write example - #11080
Merged
Merged
Conversation
Xuanwo
marked this pull request as ready for review
September 14, 2026 08:18
Member
Author
|
cc @alamb, following the same pattern as parquet. |
alamb
approved these changes
Sep 15, 2026
|
|
||
| let file_size = operator.stat(path).await?.content_length(); | ||
| let reader = OpenDalReader(operator.reader(path).await?); | ||
| let stream = AsyncAvroFileReader::builder(reader.clone(), file_size, 1024) |
| async-stream = "0.3.6" | ||
| apache-avro = "0.22.0" | ||
| object_store = { workspace = true, features = ["fs"] } | ||
| opendal = { version = "0.59.1", default-features = false, features = ["services-memory"] } |
Jefffrey
approved these changes
Sep 17, 2026
Contributor
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 18, 2026
# Which issue does this PR close? No associated issue. Follows the Parquet example in apache#11014. # Rationale for this change Demonstrate how to read Avro through OpenDAL using the generic async I/O interfaces, alongside the existing object_store example. # What changes are included in this PR? Add an in-memory round-trip example with an `AsyncFileReader` adapter using OpenDAL range reads and a `SpawnedReader` demonstration. The synchronous Avro writer encodes a small OCF in memory before uploading it. OpenDAL uses the same development dependency version and memory service as the Parquet example. # Are these changes tested? The example asserts that ordinary and dedicated-runtime reads reproduce the written `RecordBatch`, including nulls. It runs successfully with `--features async` and with `--no-default-features --features async`. Example Clippy with `-D warnings`, workspace formatting, and whitespace checks pass. # Are there any user-facing changes? A new example, runnable with `cargo run -p arrow-avro --example opendal --features async`. No public API changes. OpenDAL 0.59 requires Rust 1.91, above the workspace's declared Rust 1.88 MSRV; this affects development targets that build the new dependency. Co-authored-by: Andrew Lamb <[email protected]>
Rich-T-kid
pushed a commit
to Rich-T-kid/arrow-rs
that referenced
this pull request
Sep 21, 2026
# Which issue does this PR close? No associated issue. Follows the Parquet example in apache#11014. # Rationale for this change Demonstrate how to read Avro through OpenDAL using the generic async I/O interfaces, alongside the existing object_store example. # What changes are included in this PR? Add an in-memory round-trip example with an `AsyncFileReader` adapter using OpenDAL range reads and a `SpawnedReader` demonstration. The synchronous Avro writer encodes a small OCF in memory before uploading it. OpenDAL uses the same development dependency version and memory service as the Parquet example. # Are these changes tested? The example asserts that ordinary and dedicated-runtime reads reproduce the written `RecordBatch`, including nulls. It runs successfully with `--features async` and with `--no-default-features --features async`. Example Clippy with `-D warnings`, workspace formatting, and whitespace checks pass. # Are there any user-facing changes? A new example, runnable with `cargo run -p arrow-avro --example opendal --features async`. No public API changes. OpenDAL 0.59 requires Rust 1.91, above the workspace's declared Rust 1.88 MSRV; this affects development targets that build the new dependency. Co-authored-by: Andrew Lamb <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
No associated issue. Follows the Parquet example in #11014.
Rationale for this change
Demonstrate how to read Avro through OpenDAL using the generic async I/O interfaces, alongside the existing object_store example.
What changes are included in this PR?
Add an in-memory round-trip example with an
AsyncFileReaderadapter using OpenDAL range reads and aSpawnedReaderdemonstration. The synchronous Avro writer encodes a small OCF in memory before uploading it. OpenDAL uses the same development dependency version and memory service as the Parquet example.Are these changes tested?
The example asserts that ordinary and dedicated-runtime reads reproduce the written
RecordBatch, including nulls. It runs successfully with--features asyncand with--no-default-features --features async. Example Clippy with-D warnings, workspace formatting, and whitespace checks pass.Are there any user-facing changes?
A new example, runnable with
cargo run -p arrow-avro --example opendal --features async. No public API changes. OpenDAL 0.59 requires Rust 1.91, above the workspace's declared Rust 1.88 MSRV; this affects development targets that build the new dependency.