MCPcopy Create free account
hub / github.com/apache/datafusion / cast_list_view_column

Function cast_list_view_column

datafusion/common/src/nested_struct.rs:236–265  ·  view source on GitHub ↗
(
    source_col: &ArrayRef,
    target_inner_field: &FieldRef,
    cast_options: &CastOptions,
)

Source from the content-addressed store, hash-verified

234}
235
236fn cast_list_view_column<O: arrow::array::OffsetSizeTrait>(
237 source_col: &ArrayRef,
238 target_inner_field: &FieldRef,
239 cast_options: &CastOptions,
240) -> Result<ArrayRef> {
241 let source_list = source_col
242 .as_any()
243 .downcast_ref::<GenericListViewArray<O>>()
244 .ok_or_else(|| {
245 crate::error::DataFusionError::Plan(format!(
246 "Expected list view array but got {}",
247 source_col.data_type()
248 ))
249 })?;
250
251 let cast_values = cast_column(
252 source_list.values(),
253 target_inner_field.data_type(),
254 cast_options,
255 )?;
256
257 let result = GenericListViewArray::<O>::try_new(
258 Arc::clone(target_inner_field),
259 source_list.offsets().clone(),
260 source_list.sizes().clone(),
261 cast_values,
262 source_list.nulls().cloned(),
263 )?;
264 Ok(Arc::new(result))
265}
266
267fn cast_dictionary_column(
268 source_col: &ArrayRef,

Callers

nothing calls this directly

Calls 9

cast_columnFunction · 0.85
newFunction · 0.85
offsetsMethod · 0.80
as_anyMethod · 0.45
valuesMethod · 0.45
data_typeMethod · 0.45
cloneMethod · 0.45
clonedMethod · 0.45
nullsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…