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

Function map_keys_inner

datafusion/functions-nested/src/map_keys.rs:108–123  ·  view source on GitHub ↗
(args: &[ArrayRef])

Source from the content-addressed store, hash-verified

106}
107
108fn map_keys_inner(args: &[ArrayRef]) -> Result<ArrayRef> {
109 let [map_arg] = take_function_args("map_keys", args)?;
110
111 let map_array = match map_arg.data_type() {
112 DataType::Map(_, _) => as_map_array(&map_arg)?,
113 _ => return exec_err!("Argument for map_keys should be a map"),
114 };
115
116 Ok(Arc::new(ListArray::new(
117 // internal array nullability is true to be in sync with DuckDB
118 Arc::new(Field::new_list_field(map_array.key_type().clone(), true)),
119 map_array.offsets().clone(),
120 Arc::clone(map_array.keys()),
121 map_array.nulls().cloned(),
122 )))
123}

Callers

nothing calls this directly

Calls 8

take_function_argsFunction · 0.85
as_map_arrayFunction · 0.85
newFunction · 0.85
offsetsMethod · 0.80
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…