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

Function array_compact_inner

datafusion/functions-nested/src/array_compact.rs:110–125  ·  view source on GitHub ↗

array_compact SQL function

(arg: &[ArrayRef])

Source from the content-addressed store, hash-verified

108
109/// array_compact SQL function
110fn array_compact_inner(arg: &[ArrayRef]) -> Result<ArrayRef> {
111 let [input_array] = take_function_args("array_compact", arg)?;
112
113 match &input_array.data_type() {
114 List(field) => {
115 let array = as_list_array(input_array)?;
116 compact_list::<i32>(array, field)
117 }
118 LargeList(field) => {
119 let array = as_large_list_array(input_array)?;
120 compact_list::<i64>(array, field)
121 }
122 Null => Ok(Arc::clone(input_array)),
123 array_type => exec_err!("array_compact does not support type '{array_type}'."),
124 }
125}
126
127/// Remove null elements from each row of a list array.
128fn compact_list<O: OffsetSizeTrait>(

Callers

nothing calls this directly

Calls 4

take_function_argsFunction · 0.85
as_list_arrayFunction · 0.85
as_large_list_arrayFunction · 0.85
data_typeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…