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

Function array_dims_inner

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

Source from the content-addressed store, hash-verified

178}
179
180fn array_dims_inner(args: &[ArrayRef]) -> Result<ArrayRef> {
181 let [array] = take_function_args("array_dims", args)?;
182 let data: Vec<_> = match array.data_type() {
183 List(_) => as_list_array(&array)?
184 .iter()
185 .map(compute_array_dims)
186 .try_collect()?,
187 LargeList(_) => as_large_list_array(&array)?
188 .iter()
189 .map(compute_array_dims)
190 .try_collect()?,
191 FixedSizeList(..) => as_fixed_size_list_array(&array)?
192 .iter()
193 .map(compute_array_dims)
194 .try_collect()?,
195 arg_type => {
196 return exec_err!("array_dims does not support type {arg_type}");
197 }
198 };
199
200 let result = ListArray::from_iter_primitive::<UInt64Type, _, _>(data);
201 Ok(Arc::new(result))
202}
203
204fn array_ndims_inner(args: &[ArrayRef]) -> Result<ArrayRef> {
205 let [array] = take_function_args("array_ndims", args)?;

Callers

nothing calls this directly

Calls 8

take_function_argsFunction · 0.85
as_list_arrayFunction · 0.85
as_large_list_arrayFunction · 0.85
as_fixed_size_list_arrayFunction · 0.85
newFunction · 0.85
data_typeMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…