(
ctx: &DecoderContext,
data_type: &DataType,
is_nullable: bool,
)
| 40 | |
| 41 | impl<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 | |
| 66 | impl<O: OffsetSizeTrait, const IS_VIEW: bool> ArrayDecoder for ListLikeArrayDecoder<O, IS_VIEW> { |
nothing calls this directly
no test coverage detected