orc_rust/
lib.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18//! A native Rust implementation of the [Apache ORC](https://orc.apache.org) file format,
19//! providing API's to read data into [Apache Arrow](https://arrow.apache.org) in-memory arrays.
20//!
21//! # Example read usage
22//!
23//! ```no_run
24//! # use std::fs::File;
25//! # use orc_rust::arrow_reader::ArrowReaderBuilder;
26//! let file = File::open("/path/to/file.orc").unwrap();
27//! let reader = ArrowReaderBuilder::try_new(file).unwrap().build();
28//! let record_batches = reader.collect::<Result<Vec<_>, _>>().unwrap();
29//! ```
30//!
31//! # Example write usage
32//!
33//! ```no_run
34//! # use std::fs::File;
35//! # use arrow::array::RecordBatch;
36//! # use orc_rust::arrow_writer::ArrowWriterBuilder;
37//! # fn get_record_batch() -> RecordBatch {
38//! #     unimplemented!()
39//! # }
40//! let file = File::create("/path/to/file.orc").unwrap();
41//! let batch = get_record_batch();
42//! let mut writer = ArrowWriterBuilder::new(file, batch.schema())
43//!     .try_build()
44//!     .unwrap();
45//! writer.write(&batch).unwrap();
46//! writer.close().unwrap();
47//! ```
48
49pub mod array_decoder;
50pub mod arrow_reader;
51pub mod arrow_writer;
52#[cfg(feature = "async")]
53pub mod async_arrow_reader;
54mod column;
55pub mod compression;
56mod encoding;
57pub mod error;
58mod memory;
59pub mod projection;
60mod proto;
61pub mod reader;
62pub mod schema;
63pub mod statistics;
64pub mod stripe;
65mod writer;
66
67pub use arrow_reader::{ArrowReader, ArrowReaderBuilder};
68pub use arrow_writer::{ArrowWriter, ArrowWriterBuilder};
69#[cfg(feature = "async")]
70pub use async_arrow_reader::ArrowStreamReader;