Skip to content

Commit 78b6633

Browse files
committed
Remove LRU cache feature and refactor StoreStore + AvroSchema handling in arrow-avro reader.
1 parent 9c828c6 commit 78b6633

File tree

5 files changed

+221
-310
lines changed

5 files changed

+221
-310
lines changed

arrow-avro/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bench = false
3636
all-features = true
3737

3838
[features]
39-
default = ["deflate", "snappy", "zstd", "bzip2", "xz", "lru"]
39+
default = ["deflate", "snappy", "zstd", "bzip2", "xz"]
4040
deflate = ["flate2"]
4141
snappy = ["snap", "crc"]
4242
canonical_extension_types = ["arrow-schema/canonical_extension_types"]
@@ -57,7 +57,6 @@ xz = { version = "0.1", default-features = false, optional = true }
5757
crc = { version = "3.0", optional = true }
5858
strum_macros = "0.27"
5959
uuid = "1.17"
60-
lru = { version = "0.12", optional = true }
6160
indexmap = "2.10"
6261

6362
[dev-dependencies]

arrow-avro/src/codec.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use crate::schema::{Attributes, ComplexType, PrimitiveType, Record, Schema, TypeName};
18+
use crate::schema::{Attributes, AvroSchema, ComplexType, PrimitiveType, Record, Schema, TypeName};
1919
use arrow_schema::{
2020
ArrowError, DataType, Field, Fields, IntervalUnit, TimeUnit, DECIMAL128_MAX_PRECISION,
2121
DECIMAL128_MAX_SCALE,
@@ -145,7 +145,7 @@ impl AvroField {
145145
/// This is the primary entry point for handling schema evolution. It produces an
146146
/// `AvroField` that contains all the necessary information to read data written
147147
/// with the `writer` schema as if it were written with the `reader` schema.
148-
pub fn resolve_from_writer_and_reader<'a>(
148+
pub(crate) fn resolve_from_writer_and_reader<'a>(
149149
writer_schema: &'a Schema<'a>,
150150
reader_schema: &'a Schema<'a>,
151151
use_utf8view: bool,
@@ -181,7 +181,7 @@ impl<'a> TryFrom<&Schema<'a>> for AvroField {
181181
#[derive(Debug)]
182182
pub struct AvroFieldBuilder<'a> {
183183
writer_schema: &'a Schema<'a>,
184-
reader_schema: Option<&'a Schema<'a>>,
184+
reader_schema: Option<AvroSchema>,
185185
use_utf8view: bool,
186186
strict_mode: bool,
187187
}
@@ -202,7 +202,7 @@ impl<'a> AvroFieldBuilder<'a> {
202202
/// If a reader schema is provided, the builder will produce a resolved `AvroField`
203203
/// that can handle differences between the writer's and reader's schemas.
204204
#[inline]
205-
pub fn with_reader_schema(mut self, reader_schema: &'a Schema<'a>) -> Self {
205+
pub fn with_reader_schema(mut self, reader_schema: AvroSchema) -> Self {
206206
self.reader_schema = Some(reader_schema);
207207
self
208208
}

arrow-avro/src/reader/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl Header {
9292
}
9393

9494
/// Returns the [`Schema`] if any
95-
pub fn schema(&self) -> Result<Option<Schema<'_>>, ArrowError> {
95+
pub(crate) fn schema(&self) -> Result<Option<Schema<'_>>, ArrowError> {
9696
self.get(SCHEMA_METADATA_KEY)
9797
.map(|x| {
9898
serde_json::from_slice(x).map_err(|e| {

0 commit comments

Comments
 (0)