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

Function remove_list_null_values

datafusion/common/src/utils/mod.rs:1121–1130  ·  view source on GitHub ↗

For lists and large lists, truncates the sublist of null values Otherwise returns an error

(array: &ArrayRef)

Source from the content-addressed store, hash-verified

1119/// For lists and large lists, truncates the sublist of null values
1120/// Otherwise returns an error
1121pub fn remove_list_null_values(array: &ArrayRef) -> Result<ArrayRef> {
1122 // todo: handle list view and map
1123 match array.data_type() {
1124 DataType::List(_) => Ok(Arc::new(truncate_list_nulls(array.as_list::<i32>())?)),
1125 DataType::LargeList(_) => {
1126 Ok(Arc::new(truncate_list_nulls(array.as_list::<i64>())?))
1127 }
1128 dt => _exec_err!("expected List or LargeList, got {dt}"),
1129 }
1130}
1131
1132/// Create a new list array where all the nulls point to empty lists
1133fn truncate_list_nulls<O: OffsetSizeTrait>(

Callers 2

evaluateMethod · 0.85

Calls 3

newFunction · 0.85
truncate_list_nullsFunction · 0.85
data_typeMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…