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

Method dictionary

arrow-array/src/ffi.rs:567–582  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

565 }
566
567 fn dictionary(&self) -> Result<Option<ImportedArrowArray<'_>>> {
568 match (self.array.dictionary(), &self.data_type) {
569 (Some(array), DataType::Dictionary(_, value_type)) => Ok(Some(ImportedArrowArray {
570 array,
571 data_type: value_type.as_ref().clone(),
572 owner: self.owner,
573 })),
574 (Some(_), _) => Err(ArrowError::CDataInterface(
575 "Got dictionary in FFI_ArrowArray for non-dictionary data type".to_string(),
576 )),
577 (None, DataType::Dictionary(_, _)) => Err(ArrowError::CDataInterface(
578 "Missing dictionary in FFI_ArrowArray for dictionary data type".to_string(),
579 )),
580 (_, _) => Ok(None),
581 }
582 }
583}
584
585#[cfg(test)]

Callers 1

consumeMethod · 0.45

Calls 2

cloneMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected