/Users/andrewlamb/Software/arrow-rs/arrow-avro/src/lib.rs
Line | Count | Source |
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 | | //! Convert data to / from the [Apache Arrow] memory format and [Apache Avro] |
19 | | //! |
20 | | //! [Apache Arrow]: https://arrow.apache.org |
21 | | //! [Apache Avro]: https://avro.apache.org/ |
22 | | |
23 | | #![doc( |
24 | | html_logo_url = "https://arrow.apache.org/img/arrow-logo_chevrons_black-txt_white-bg.svg", |
25 | | html_favicon_url = "https://arrow.apache.org/img/arrow-logo_chevrons_black-txt_transparent-bg.svg" |
26 | | )] |
27 | | #![cfg_attr(docsrs, feature(doc_auto_cfg))] |
28 | | #![warn(missing_docs)] |
29 | | #![allow(unused)] // Temporary |
30 | | |
31 | | /// Core functionality for reading Avro data into Arrow arrays |
32 | | /// |
33 | | /// Implements the primary reader interface and record decoding logic. |
34 | | pub mod reader; |
35 | | |
36 | | /// Core functionality for writing Arrow arrays as Avro data |
37 | | /// |
38 | | /// Implements the primary writer interface and record encoding logic. |
39 | | pub mod writer; |
40 | | |
41 | | /// Avro schema parsing and representation |
42 | | /// |
43 | | /// Provides types for parsing and representing Avro schema definitions. |
44 | | pub mod schema; |
45 | | |
46 | | /// Compression codec implementations for Avro |
47 | | /// |
48 | | /// Provides support for various compression algorithms used in Avro files, |
49 | | /// including Deflate, Snappy, and ZStandard. |
50 | | pub mod compression; |
51 | | |
52 | | /// Data type conversions between Avro and Arrow types |
53 | | /// |
54 | | /// This module contains the necessary types and functions to convert between |
55 | | /// Avro data types and Arrow data types. |
56 | | pub mod codec; |
57 | | |
58 | | /// Extension trait for AvroField to add Utf8View support |
59 | | /// |
60 | | /// This trait adds methods for working with Utf8View support to the AvroField struct. |
61 | | pub trait AvroFieldExt { |
62 | | /// Returns a new field with Utf8View support enabled for string data |
63 | | /// |
64 | | /// This will convert any string data to use StringViewArray instead of StringArray. |
65 | | fn with_utf8view(&self) -> Self; |
66 | | } |
67 | | |
68 | | impl AvroFieldExt for codec::AvroField { |
69 | 0 | fn with_utf8view(&self) -> Self { |
70 | 0 | codec::AvroField::with_utf8view(self) |
71 | 0 | } |
72 | | } |
73 | | |
74 | | #[cfg(test)] |
75 | | mod test_util { |
76 | 50 | pub fn arrow_test_data(path: &str) -> String { |
77 | 50 | match std::env::var("ARROW_TEST_DATA") { |
78 | 0 | Ok(dir) => format!("{dir}/{path}"), |
79 | 50 | Err(_) => format!("../testing/data/{path}"), |
80 | | } |
81 | 50 | } |
82 | | } |