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

Method new

arrow-json/src/reader/list_array.rs:42–63  ·  view source on GitHub ↗
(
        ctx: &DecoderContext,
        data_type: &DataType,
        is_nullable: bool,
    )

Source from the content-addressed store, hash-verified

40
41impl<O: OffsetSizeTrait, const IS_VIEW: bool> ListLikeArrayDecoder<O, IS_VIEW> {
42 pub fn new(
43 ctx: &DecoderContext,
44 data_type: &DataType,
45 is_nullable: bool,
46 ) -> Result<Self, ArrowError> {
47 let field = match (IS_VIEW, data_type) {
48 (false, DataType::List(f)) if !O::IS_LARGE => f,
49 (false, DataType::LargeList(f)) if O::IS_LARGE => f,
50 (true, DataType::ListView(f)) if !O::IS_LARGE => f,
51 (true, DataType::LargeListView(f)) if O::IS_LARGE => f,
52 _ => unreachable!(),
53 };
54 let decoder = ctx.make_decoder(field.data_type(), field.is_nullable())?;
55
56 Ok(Self {
57 field: field.clone(),
58 decoder,
59 phantom: Default::default(),
60 ignore_type_conflicts: ctx.ignore_type_conflicts(),
61 is_nullable,
62 })
63 }
64}
65
66impl<O: OffsetSizeTrait, const IS_VIEW: bool> ArrayDecoder for ListLikeArrayDecoder<O, IS_VIEW> {

Callers

nothing calls this directly

Calls 6

defaultFunction · 0.85
ignore_type_conflictsMethod · 0.80
make_decoderMethod · 0.45
data_typeMethod · 0.45
is_nullableMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected