MCPcopy Create free account
hub / github.com/apache/arrow-rs / new_decoder_id

Function new_decoder_id

arrow-avro/benches/decoder.rs:368–387  ·  view source on GitHub ↗
(
    schema_json: &'static str,
    batch_size: usize,
    utf8view: bool,
    id: u32,
)

Source from the content-addressed store, hash-verified

366}
367
368fn new_decoder_id(
369 schema_json: &'static str,
370 batch_size: usize,
371 utf8view: bool,
372 id: u32,
373) -> arrow_avro::reader::Decoder {
374 let schema = AvroSchema::new(schema_json.parse().unwrap());
375 let mut store = arrow_avro::schema::SchemaStore::new_with_type(FingerprintAlgorithm::Id);
376 // Register the schema with a provided Confluent-style ID
377 store
378 .set(Fingerprint::Id(id), schema.clone())
379 .expect("failed to set schema with id");
380 ReaderBuilder::new()
381 .with_writer_schema_store(store)
382 .with_active_fingerprint(Fingerprint::Id(id))
383 .with_batch_size(batch_size)
384 .with_utf8_view(utf8view)
385 .build_decoder()
386 .expect("failed to build decoder for id")
387}
388
389const SIZES: [usize; 3] = [100, 10_000, 1_000_000];
390

Callers 1

criterion_benchesFunction · 0.85

Calls 8

parseMethod · 0.45
setMethod · 0.45
cloneMethod · 0.45
build_decoderMethod · 0.45
with_utf8_viewMethod · 0.45
with_batch_sizeMethod · 0.45

Tested by

no test coverage detected