mbrobbel commented on code in PR #8556:
URL: https://github.com/apache/arrow-rs/pull/8556#discussion_r2405213234


##########
arrow-avro/README.md:
##########
@@ -0,0 +1,182 @@
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+# `arrow-avro`
+
+[![crates.io](https://img.shields.io/crates/v/arrow-avro.svg)](https://crates.io/crates/arrow-avro)
+[![docs.rs](https://img.shields.io/docsrs/arrow-avro.svg)](https://docs.rs/arrow-avro/latest/arrow_avro/)
+
+Transfer data between the [Apache Arrow] memory format and [Apache Avro].
+
+This crate provides:
+
+- a **reader** that decodes Avro
+  - **Object Container Files (OCF)**,
+  - **Avro Single‑Object Encoding (SOE)**, and
+  - **Confluent Schema Registry wire format**  
+  into Arrow `RecordBatch`es; and
+- a **writer** that encodes Arrow `RecordBatch`es into Avro (**OCF** or 
**SOE**).
+
+> The latest API docs for `main` (unreleased) are published on the Arrow 
website: **arrow_avro**.
+
+[Apache Arrow]: https://arrow.apache.org/
+[Apache Avro]: https://avro.apache.org/
+
+---
+
+## Install
+
+```toml
+[dependencies]
+arrow-avro = "56"
+````
+
+Disable defaults and pick only what you need (see **Feature Flags**):
+
+```toml
+[dependencies]
+arrow-avro = { version = "56", default-features = false, features = 
["deflate", "snappy"] }
+```
+
+---
+
+## Quick start
+
+### Read an Avro OCF file into Arrow
+
+```rust
+use std::fs::File;
+use std::io::BufReader;
+
+use arrow_avro::reader::ReaderBuilder;
+use arrow_array::RecordBatch;
+
+fn main() -> anyhow::Result<()> {
+    let file = BufReader::new(File::open("data/example.avro")?);
+    let mut reader = ReaderBuilder::new().build(file)?;
+    while let Some(batch) = reader.next() {
+        let batch: RecordBatch = batch?;
+        println!("rows: {}", batch.num_rows());
+    }
+    Ok(())
+}
+```
+
+### Write Arrow to Avro OCF (in‑memory)
+
+```rust
+use std::sync::Arc;
+
+use arrow_avro::writer::AvroWriter;
+use arrow_array::{ArrayRef, Int32Array, RecordBatch};
+use arrow_schema::{DataType, Field, Schema};
+
+fn main() -> anyhow::Result<()> {
+    let schema = Schema::new(vec![Field::new("id", DataType::Int32, false)]);
+    let batch = RecordBatch::try_new(
+        Arc::new(schema.clone()),
+        vec![Arc::new(Int32Array::from(vec![1, 2, 3])) as ArrayRef],
+    )?;
+
+    let sink: Vec<u8> = Vec::new();
+    let mut w = AvroWriter::new(sink, schema)?;
+    w.write(&batch)?;
+    w.finish()?;
+    assert!(!w.into_inner().is_empty());
+    Ok(())
+}
+```
+
+See the crate docs for runnable SOE and Confluent round‑trip examples.
+
+---
+
+## Feature Flags (what they do and when to use them)
+
+### Compression codecs (OCF block compression)
+
+`arrow-avro` supports the Avro‑standard OCF codecs. The **defaults** include 
all five: `deflate`, `snappy`, `zstd`, `bzip2`, and `xz`.

Review Comment:
   I noticed some of these features are missing from the docs in `lib.rs`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to