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

Function array_ndims_inner

datafusion/functions-nested/src/dimension.rs:204–219  ·  view source on GitHub ↗
(args: &[ArrayRef])

Source from the content-addressed store, hash-verified

202}
203
204fn array_ndims_inner(args: &[ArrayRef]) -> Result<ArrayRef> {
205 let [array] = take_function_args("array_ndims", args)?;
206
207 fn general_list_ndims(array: &ArrayRef) -> Result<ArrayRef> {
208 let ndims = list_ndims(array.data_type());
209 let data = vec![ndims; array.len()];
210 let result = UInt64Array::new(data.into(), array.nulls().cloned());
211 Ok(Arc::new(result))
212 }
213
214 match array.data_type() {
215 Null => Ok(Arc::new(UInt64Array::new_null(array.len()))),
216 List(_) | LargeList(_) | FixedSizeList(..) => general_list_ndims(array),
217 arg_type => exec_err!("array_ndims does not support type {arg_type}"),
218 }
219}

Callers

nothing calls this directly

Calls 5

take_function_argsFunction · 0.85
newFunction · 0.85
general_list_ndimsFunction · 0.85
data_typeMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…