Skip to content

Commit e32483c

Browse files
committed
Merge branch 'main' into issue-8670-decimal-cast-refactor
2 parents 04505a0 + a7572eb commit e32483c

File tree

46 files changed

+4583
-2721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4583
-2721
lines changed

CHANGELOG-old.md

Lines changed: 414 additions & 0 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 228 additions & 124 deletions
Large diffs are not rendered by default.

Cargo.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ exclude = [
6868
]
6969

7070
[workspace.package]
71-
version = "56.2.0"
71+
version = "57.0.0"
7272
homepage = "https://github.com/apache/arrow-rs"
7373
repository = "https://github.com/apache/arrow-rs"
7474
authors = ["Apache Arrow <[email protected]>"]
@@ -85,22 +85,22 @@ edition = "2024"
8585
rust-version = "1.85"
8686

8787
[workspace.dependencies]
88-
arrow = { version = "56.2.0", path = "./arrow", default-features = false }
89-
arrow-arith = { version = "56.2.0", path = "./arrow-arith" }
90-
arrow-array = { version = "56.2.0", path = "./arrow-array" }
91-
arrow-buffer = { version = "56.2.0", path = "./arrow-buffer" }
92-
arrow-cast = { version = "56.2.0", path = "./arrow-cast" }
93-
arrow-csv = { version = "56.2.0", path = "./arrow-csv" }
94-
arrow-data = { version = "56.2.0", path = "./arrow-data" }
95-
arrow-ipc = { version = "56.2.0", path = "./arrow-ipc" }
96-
arrow-json = { version = "56.2.0", path = "./arrow-json" }
97-
arrow-ord = { version = "56.2.0", path = "./arrow-ord" }
98-
arrow-pyarrow = { version = "56.2.0", path = "./arrow-pyarrow" }
99-
arrow-row = { version = "56.2.0", path = "./arrow-row" }
100-
arrow-schema = { version = "56.2.0", path = "./arrow-schema" }
101-
arrow-select = { version = "56.2.0", path = "./arrow-select" }
102-
arrow-string = { version = "56.2.0", path = "./arrow-string" }
103-
parquet = { version = "56.2.0", path = "./parquet", default-features = false }
88+
arrow = { version = "57.0.0", path = "./arrow", default-features = false }
89+
arrow-arith = { version = "57.0.0", path = "./arrow-arith" }
90+
arrow-array = { version = "57.0.0", path = "./arrow-array" }
91+
arrow-buffer = { version = "57.0.0", path = "./arrow-buffer" }
92+
arrow-cast = { version = "57.0.0", path = "./arrow-cast" }
93+
arrow-csv = { version = "57.0.0", path = "./arrow-csv" }
94+
arrow-data = { version = "57.0.0", path = "./arrow-data" }
95+
arrow-ipc = { version = "57.0.0", path = "./arrow-ipc" }
96+
arrow-json = { version = "57.0.0", path = "./arrow-json" }
97+
arrow-ord = { version = "57.0.0", path = "./arrow-ord" }
98+
arrow-pyarrow = { version = "57.0.0", path = "./arrow-pyarrow" }
99+
arrow-row = { version = "57.0.0", path = "./arrow-row" }
100+
arrow-schema = { version = "57.0.0", path = "./arrow-schema" }
101+
arrow-select = { version = "57.0.0", path = "./arrow-select" }
102+
arrow-string = { version = "57.0.0", path = "./arrow-string" }
103+
parquet = { version = "57.0.0", path = "./parquet", default-features = false }
104104

105105
# These crates have not yet been released and thus do not use the workspace version
106106
parquet-geospatial = { version = "0.1.0", path = "./parquet-geospatial" }

arrow-array/src/array/list_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ impl<OffsetSize: OffsetSizeTrait> From<FixedSizeListArray> for GenericListArray<
466466
_ => unreachable!(),
467467
};
468468

469-
let offsets = OffsetBuffer::from_lengths(std::iter::repeat_n(size, value.len()));
469+
let offsets = OffsetBuffer::from_repeated_length(size, value.len());
470470

471471
Self {
472472
data_type: Self::DATA_TYPE_CONSTRUCTOR(field.clone()),

arrow-array/src/builder/generic_bytes_view_builder.rs

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,30 @@ impl<T: ByteViewType + ?Sized> GenericByteViewBuilder<T> {
306306
/// - String length exceeds `u32::MAX`
307307
#[inline]
308308
pub fn append_value(&mut self, value: impl AsRef<T::Native>) {
309+
self.try_append_value(value).unwrap()
310+
}
311+
312+
/// Appends a value into the builder
313+
///
314+
/// # Errors
315+
///
316+
/// Returns an error if:
317+
/// - String buffer count exceeds `u32::MAX`
318+
/// - String length exceeds `u32::MAX`
319+
#[inline]
320+
pub fn try_append_value(&mut self, value: impl AsRef<T::Native>) -> Result<(), ArrowError> {
309321
let v: &[u8] = value.as_ref().as_ref();
310-
let length: u32 = v.len().try_into().unwrap();
322+
let length: u32 = v.len().try_into().map_err(|_| {
323+
ArrowError::InvalidArgumentError(format!("String length {} exceeds u32::MAX", v.len()))
324+
})?;
325+
311326
if length <= MAX_INLINE_VIEW_LEN {
312327
let mut view_buffer = [0; 16];
313328
view_buffer[0..4].copy_from_slice(&length.to_le_bytes());
314329
view_buffer[4..4 + v.len()].copy_from_slice(v);
315330
self.views_buffer.push(u128::from_le_bytes(view_buffer));
316331
self.null_buffer_builder.append_non_null();
317-
return;
332+
return Ok(());
318333
}
319334

320335
// Deduplication if:
@@ -339,7 +354,7 @@ impl<T: ByteViewType + ?Sized> GenericByteViewBuilder<T> {
339354
self.views_buffer.push(self.views_buffer[*idx]);
340355
self.null_buffer_builder.append_non_null();
341356
self.string_tracker = Some((ht, hasher));
342-
return;
357+
return Ok(());
343358
}
344359
Entry::Vacant(vacant) => {
345360
// o.w. we insert the (string hash -> view index)
@@ -356,17 +371,28 @@ impl<T: ByteViewType + ?Sized> GenericByteViewBuilder<T> {
356371
let to_reserve = v.len().max(self.block_size.next_size() as usize);
357372
self.in_progress.reserve(to_reserve);
358373
};
374+
359375
let offset = self.in_progress.len() as u32;
360376
self.in_progress.extend_from_slice(v);
361377

378+
let buffer_index: u32 = self.completed.len().try_into().map_err(|_| {
379+
ArrowError::InvalidArgumentError(format!(
380+
"Buffer count {} exceeds u32::MAX",
381+
self.completed.len()
382+
))
383+
})?;
384+
362385
let view = ByteView {
363386
length,
387+
// This won't panic as we checked the length of prefix earlier.
364388
prefix: u32::from_le_bytes(v[0..4].try_into().unwrap()),
365-
buffer_index: self.completed.len() as u32,
389+
buffer_index,
366390
offset,
367391
};
368392
self.views_buffer.push(view.into());
369393
self.null_buffer_builder.append_non_null();
394+
395+
Ok(())
370396
}
371397

372398
/// Append an `Option` value into the builder
@@ -581,7 +607,6 @@ mod tests {
581607
use core::str;
582608

583609
use super::*;
584-
use crate::Array;
585610

586611
#[test]
587612
fn test_string_view_deduplicate() {

arrow-array/src/types.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ pub trait DecimalType:
13241324
/// Maximum no of digits after the decimal point (note the scale can be negative)
13251325
const MAX_SCALE: i8;
13261326
/// The maximum value for each precision in `0..=MAX_PRECISION`: [0, 9, 99, ...]
1327-
const MAX_FOR_EACH_PRECISION: &[Self::Native];
1327+
const MAX_FOR_EACH_PRECISION: &'static [Self::Native];
13281328
/// fn to create its [`DataType`]
13291329
const TYPE_CONSTRUCTOR: fn(u8, i8) -> DataType;
13301330
/// Default values for [`DataType`]
@@ -1395,7 +1395,8 @@ impl DecimalType for Decimal32Type {
13951395
const BYTE_LENGTH: usize = 4;
13961396
const MAX_PRECISION: u8 = DECIMAL32_MAX_PRECISION;
13971397
const MAX_SCALE: i8 = DECIMAL32_MAX_SCALE;
1398-
const MAX_FOR_EACH_PRECISION: &[i32] = &arrow_data::decimal::MAX_DECIMAL32_FOR_EACH_PRECISION;
1398+
const MAX_FOR_EACH_PRECISION: &'static [i32] =
1399+
&arrow_data::decimal::MAX_DECIMAL32_FOR_EACH_PRECISION;
13991400
const TYPE_CONSTRUCTOR: fn(u8, i8) -> DataType = DataType::Decimal32;
14001401
const DEFAULT_TYPE: DataType =
14011402
DataType::Decimal32(DECIMAL32_MAX_PRECISION, DECIMAL32_DEFAULT_SCALE);
@@ -1430,7 +1431,8 @@ impl DecimalType for Decimal64Type {
14301431
const BYTE_LENGTH: usize = 8;
14311432
const MAX_PRECISION: u8 = DECIMAL64_MAX_PRECISION;
14321433
const MAX_SCALE: i8 = DECIMAL64_MAX_SCALE;
1433-
const MAX_FOR_EACH_PRECISION: &[i64] = &arrow_data::decimal::MAX_DECIMAL64_FOR_EACH_PRECISION;
1434+
const MAX_FOR_EACH_PRECISION: &'static [i64] =
1435+
&arrow_data::decimal::MAX_DECIMAL64_FOR_EACH_PRECISION;
14341436
const TYPE_CONSTRUCTOR: fn(u8, i8) -> DataType = DataType::Decimal64;
14351437
const DEFAULT_TYPE: DataType =
14361438
DataType::Decimal64(DECIMAL64_MAX_PRECISION, DECIMAL64_DEFAULT_SCALE);
@@ -1465,7 +1467,8 @@ impl DecimalType for Decimal128Type {
14651467
const BYTE_LENGTH: usize = 16;
14661468
const MAX_PRECISION: u8 = DECIMAL128_MAX_PRECISION;
14671469
const MAX_SCALE: i8 = DECIMAL128_MAX_SCALE;
1468-
const MAX_FOR_EACH_PRECISION: &[i128] = &arrow_data::decimal::MAX_DECIMAL128_FOR_EACH_PRECISION;
1470+
const MAX_FOR_EACH_PRECISION: &'static [i128] =
1471+
&arrow_data::decimal::MAX_DECIMAL128_FOR_EACH_PRECISION;
14691472
const TYPE_CONSTRUCTOR: fn(u8, i8) -> DataType = DataType::Decimal128;
14701473
const DEFAULT_TYPE: DataType =
14711474
DataType::Decimal128(DECIMAL128_MAX_PRECISION, DECIMAL_DEFAULT_SCALE);
@@ -1500,7 +1503,8 @@ impl DecimalType for Decimal256Type {
15001503
const BYTE_LENGTH: usize = 32;
15011504
const MAX_PRECISION: u8 = DECIMAL256_MAX_PRECISION;
15021505
const MAX_SCALE: i8 = DECIMAL256_MAX_SCALE;
1503-
const MAX_FOR_EACH_PRECISION: &[i256] = &arrow_data::decimal::MAX_DECIMAL256_FOR_EACH_PRECISION;
1506+
const MAX_FOR_EACH_PRECISION: &'static [i256] =
1507+
&arrow_data::decimal::MAX_DECIMAL256_FOR_EACH_PRECISION;
15041508
const TYPE_CONSTRUCTOR: fn(u8, i8) -> DataType = DataType::Decimal256;
15051509
const DEFAULT_TYPE: DataType =
15061510
DataType::Decimal256(DECIMAL256_MAX_PRECISION, DECIMAL_DEFAULT_SCALE);

arrow-avro/src/lib.rs

Lines changed: 4 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
//! This crate provides:
2121
//! - a [`reader`] that decodes Avro (Object Container Files, Avro Single‑Object encoding,
2222
//! and Confluent Schema Registry wire format) into Arrow `RecordBatch`es,
23-
//! - and a [`writer`] that encodes Arrow `RecordBatch`es into Avro (OCF or raw Avro binary).
23+
//! - and a [`writer`] that encodes Arrow `RecordBatch`es into Avro (OCF or SOE).
2424
//!
2525
//! If you’re new to Arrow or Avro, see:
2626
//! - Arrow project site: <https://arrow.apache.org/>
2727
//! - Avro 1.11.1 specification: <https://avro.apache.org/docs/1.11.1/specification/>
2828
//!
29-
//! ## Example: OCF (Object Container File) round‑trip
29+
//! ## Example: OCF (Object Container File) round‑trip *(runnable)*
3030
//!
3131
//! The example below creates an Arrow table, writes an **Avro OCF** fully in memory,
3232
//! and then reads it back. OCF is a self‑describing file format that embeds the Avro
@@ -64,82 +64,7 @@
6464
//! # Ok(()) }
6565
//! ```
6666
//!
67-
//! ## Quickstart: Confluent wire‑format round‑trip *(runnable)*
68-
//!
69-
//! The **Confluent Schema Registry wire format** prefixes each Avro message with a
70-
//! 1‑byte magic `0x00` and a **4‑byte big‑endian** schema ID, followed by the Avro body.
71-
//! See: <https://docs.confluent.io/platform/current/schema-registry/fundamentals/serdes-develop/index.html#wire-format>
72-
//!
73-
//! In this round‑trip, we:
74-
//! 1) Use `AvroStreamWriter` to create a **raw Avro body** for a single‑row batch,
75-
//! 2) Wrap it with the Confluent prefix (magic and schema ID),
76-
//! 3) Decode it back to Arrow using a `Decoder` configured with a `SchemaStore` that
77-
//! maps the schema ID to the Avro schema used by the writer.
78-
//!
79-
//! ```
80-
//! use std::collections::HashMap;
81-
//! use std::sync::Arc;
82-
//! use arrow_array::{ArrayRef, Int64Array, RecordBatch, StringArray};
83-
//! use arrow_schema::{DataType, Field, Schema};
84-
//! use arrow_avro::writer::{AvroStreamWriter, WriterBuilder};
85-
//! use arrow_avro::reader::ReaderBuilder;
86-
//! use arrow_avro::schema::{
87-
//! AvroSchema, SchemaStore, Fingerprint, FingerprintAlgorithm,
88-
//! FingerprintStrategy, SCHEMA_METADATA_KEY
89-
//! };
90-
//!
91-
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
92-
//! // Writer schema registered under Schema Registry ID 1
93-
//! let avro_json = r#"{
94-
//! "type":"record","name":"User",
95-
//! "fields":[{"name":"id","type":"long"},{"name":"name","type":"string"}]
96-
//! }"#;
97-
//!
98-
//! let mut store = SchemaStore::new_with_type(FingerprintAlgorithm::Id);
99-
//! let id: u32 = 1;
100-
//! store.set(Fingerprint::Id(id), AvroSchema::new(avro_json.to_string()))?;
101-
//!
102-
//! // Build an Arrow schema that references the same Avro JSON
103-
//! let mut md = HashMap::new();
104-
//! md.insert(SCHEMA_METADATA_KEY.to_string(), avro_json.to_string());
105-
//! let schema = Schema::new_with_metadata(
106-
//! vec![
107-
//! Field::new("id", DataType::Int64, false),
108-
//! Field::new("name", DataType::Utf8, false),
109-
//! ],
110-
//! md,
111-
//! );
112-
//!
113-
//! // One‑row batch: { id: 42, name: "alice" }
114-
//! let batch = RecordBatch::try_new(
115-
//! Arc::new(schema.clone()),
116-
//! vec![
117-
//! Arc::new(Int64Array::from(vec![42])) as ArrayRef,
118-
//! Arc::new(StringArray::from(vec!["alice"])) as ArrayRef,
119-
//! ],
120-
//! )?;
121-
//!
122-
//! // Stream‑write a single record, letting the writer add the **Confluent** prefix.
123-
//! let sink: Vec<u8> = Vec::new();
124-
//! let mut w: AvroStreamWriter<Vec<u8>> = WriterBuilder::new(schema.clone())
125-
//! .with_fingerprint_strategy(FingerprintStrategy::Id(id))
126-
//! .build(sink)?;
127-
//! w.write(&batch)?;
128-
//! w.finish()?;
129-
//! let frame = w.into_inner(); // already: 0x00 + 4B BE ID + Avro body
130-
//! assert!(frame.len() > 5);
131-
//!
132-
//! // Decode
133-
//! let mut dec = ReaderBuilder::new()
134-
//! .with_writer_schema_store(store)
135-
//! .build_decoder()?;
136-
//! dec.decode(&frame)?;
137-
//! let out = dec.flush()?.expect("one row");
138-
//! assert_eq!(out.num_rows(), 1);
139-
//! # Ok(()) }
140-
//! ```
141-
//!
142-
//! ## Quickstart: Avro Single‑Object Encoding round‑trip *(runnable)*
67+
//! ## Quickstart: SOE (Single‑Object Encoding) round‑trip *(runnable)*
14368
//!
14469
//! Avro **Single‑Object Encoding (SOE)** wraps an Avro body with a 2‑byte marker
14570
//! `0xC3 0x01` and an **8‑byte little‑endian CRC‑64‑AVRO Rabin fingerprint** of the
@@ -203,7 +128,7 @@
203128
//! ### Modules
204129
//!
205130
//! - [`reader`]: read Avro (OCF, SOE, Confluent) into Arrow `RecordBatch`es.
206-
//! - [`writer`]: write Arrow `RecordBatch`es as Avro (OCF, SOE, Confluent).
131+
//! - [`writer`]: write Arrow `RecordBatch`es as Avro (OCF, SOE, Confluent, Apicurio).
207132
//! - [`schema`]: Avro schema parsing / fingerprints / registries.
208133
//! - [`compression`]: codecs used for **OCF block compression** (i.e., Deflate, Snappy, Zstandard, BZip2, and XZ).
209134
//! - [`codec`]: internal Avro-Arrow type conversion and row decode/encode plans.

arrow-avro/src/reader/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
//! * [`Reader`](crate::reader::Reader): a convenient, synchronous iterator over `RecordBatch` decoded from an OCF
4343
//! input. Implements [`Iterator<Item = Result<RecordBatch, ArrowError>>`] and
4444
//! `RecordBatchReader`.
45-
//! * [`Decoder`](crate::reader::Decoder): a push‑based row decoder that consumes raw Avro bytes and yields ready
45+
//! * [`Decoder`](crate::reader::Decoder): a push‑based row decoder that consumes SOE framed Avro bytes and yields ready
4646
//! `RecordBatch` values when batches fill. This is suitable for integrating with async
4747
//! byte streams, network protocols, or other custom data sources.
4848
//!
@@ -167,7 +167,7 @@
167167
//! use arrow_array::{ArrayRef, Int64Array, RecordBatch};
168168
//! use arrow_schema::{DataType, Field, Schema};
169169
//! use arrow_avro::schema::{AvroSchema, SchemaStore, SCHEMA_METADATA_KEY, FingerprintStrategy};
170-
//! use arrow_avro::writer::{WriterBuilder, format::AvroBinaryFormat};
170+
//! use arrow_avro::writer::{WriterBuilder, format::AvroSoeFormat};
171171
//! use arrow_avro::reader::ReaderBuilder;
172172
//!
173173
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -187,7 +187,7 @@
187187
//! )?;
188188
//! let mut w = WriterBuilder::new(arrow)
189189
//! .with_fingerprint_strategy(FingerprintStrategy::Rabin) // SOE prefix
190-
//! .build::<_, AvroBinaryFormat>(Vec::new())?;
190+
//! .build::<_, AvroSoeFormat>(Vec::new())?;
191191
//! w.write(&batch)?;
192192
//! w.finish()?;
193193
//! let frame = w.into_inner(); // C3 01 + fp + Avro body
@@ -220,7 +220,7 @@
220220
//! use arrow_array::{ArrayRef, Int64Array, StringArray, RecordBatch};
221221
//! use arrow_schema::{DataType, Field, Schema};
222222
//! use arrow_avro::schema::{AvroSchema, SchemaStore, Fingerprint, FingerprintAlgorithm, SCHEMA_METADATA_KEY, FingerprintStrategy};
223-
//! use arrow_avro::writer::{WriterBuilder, format::AvroBinaryFormat};
223+
//! use arrow_avro::writer::{WriterBuilder, format::AvroSoeFormat};
224224
//! use arrow_avro::reader::ReaderBuilder;
225225
//!
226226
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -248,7 +248,7 @@
248248
//! )?;
249249
//! let mut w = WriterBuilder::new(arrow)
250250
//! .with_fingerprint_strategy(FingerprintStrategy::Id(schema_id)) // 0x00 + ID + body
251-
//! .build::<_, AvroBinaryFormat>(Vec::new())?;
251+
//! .build::<_, AvroSoeFormat>(Vec::new())?;
252252
//! w.write(&batch)?; w.finish()?;
253253
//! Ok(w.into_inner())
254254
//! }
@@ -402,7 +402,7 @@
402402
//! Arc::new(StringArray::from(vec!["v0-alice"])) as ArrayRef])?;
403403
//! let mut w0 = arrow_avro::writer::WriterBuilder::new(arrow0)
404404
//! .with_fingerprint_strategy(FingerprintStrategy::Id(id_v0))
405-
//! .build::<_, arrow_avro::writer::format::AvroBinaryFormat>(Vec::new())?;
405+
//! .build::<_, arrow_avro::writer::format::AvroSoeFormat>(Vec::new())?;
406406
//! w0.write(&batch0)?; w0.finish()?;
407407
//! let frame0 = w0.into_inner(); // 0x00 + id_v0 + body
408408
//!
@@ -420,7 +420,7 @@
420420
//! Arc::new(StringArray::from(vec![Some("[email protected]")])) as ArrayRef])?;
421421
//! let mut w1 = arrow_avro::writer::WriterBuilder::new(arrow1)
422422
//! .with_fingerprint_strategy(FingerprintStrategy::Id(id_v1))
423-
//! .build::<_, arrow_avro::writer::format::AvroBinaryFormat>(Vec::new())?;
423+
//! .build::<_, arrow_avro::writer::format::AvroSoeFormat>(Vec::new())?;
424424
//! w1.write(&batch1)?; w1.finish()?;
425425
//! let frame1 = w1.into_inner(); // 0x00 + id_v1 + body
426426
//!
@@ -563,15 +563,15 @@ fn is_incomplete_data(err: &ArrowError) -> bool {
563563
/// # use arrow_array::{ArrayRef, Int64Array, RecordBatch};
564564
/// # use arrow_schema::{DataType, Field, Schema};
565565
/// # use arrow_avro::schema::{SCHEMA_METADATA_KEY, FingerprintStrategy};
566-
/// # use arrow_avro::writer::{WriterBuilder, format::AvroBinaryFormat};
566+
/// # use arrow_avro::writer::{WriterBuilder, format::AvroSoeFormat};
567567
/// # let mut md = HashMap::new();
568568
/// # md.insert(SCHEMA_METADATA_KEY.to_string(),
569569
/// # r#"{"type":"record","name":"E","fields":[{"name":"x","type":"long"}]}"#.to_string());
570570
/// # let arrow = Schema::new_with_metadata(vec![Field::new("x", DataType::Int64, false)], md);
571571
/// # let batch = RecordBatch::try_new(Arc::new(arrow.clone()), vec![Arc::new(Int64Array::from(vec![7])) as ArrayRef])?;
572572
/// # let mut w = WriterBuilder::new(arrow)
573573
/// # .with_fingerprint_strategy(fp.into())
574-
/// # .build::<_, AvroBinaryFormat>(Vec::new())?;
574+
/// # .build::<_, AvroSoeFormat>(Vec::new())?;
575575
/// # w.write(&batch)?; w.finish()?; let frame = w.into_inner();
576576
///
577577
/// let mut decoder = ReaderBuilder::new()
@@ -605,7 +605,7 @@ fn is_incomplete_data(err: &ArrowError) -> bool {
605605
/// # use arrow_array::{ArrayRef, Int64Array, RecordBatch};
606606
/// # use arrow_schema::{DataType, Field, Schema};
607607
/// # use arrow_avro::schema::{SCHEMA_METADATA_KEY, FingerprintStrategy};
608-
/// # use arrow_avro::writer::{WriterBuilder, format::AvroBinaryFormat};
608+
/// # use arrow_avro::writer::{WriterBuilder, format::AvroSoeFormat};
609609
/// # fn msg(x: i64) -> Result<Vec<u8>, Box<dyn std::error::Error>> {
610610
/// # let mut md = HashMap::new();
611611
/// # md.insert(SCHEMA_METADATA_KEY.to_string(),
@@ -614,7 +614,7 @@ fn is_incomplete_data(err: &ArrowError) -> bool {
614614
/// # let batch = RecordBatch::try_new(Arc::new(arrow.clone()), vec![Arc::new(Int64Array::from(vec![x])) as ArrayRef])?;
615615
/// # let mut w = WriterBuilder::new(arrow)
616616
/// # .with_fingerprint_strategy(FingerprintStrategy::Id(1234))
617-
/// # .build::<_, AvroBinaryFormat>(Vec::new())?;
617+
/// # .build::<_, AvroSoeFormat>(Vec::new())?;
618618
/// # w.write(&batch)?; w.finish()?; Ok(w.into_inner())
619619
/// # }
620620
/// # let m1 = msg(1)?;

0 commit comments

Comments
 (0)