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

Function validate_unique_binary_keys

datafusion/functions-nested/src/map.rs:144–158  ·  view source on GitHub ↗
(
    null_count: usize,
    len: usize,
    values: impl IntoIterator<Item = &'a [u8]>,
)

Source from the content-addressed store, hash-verified

142}
143
144fn validate_unique_binary_keys<'a>(
145 null_count: usize,
146 len: usize,
147 values: impl IntoIterator<Item = &'a [u8]>,
148) -> Result<()> {
149 if null_count > 0 {
150 return exec_err!("map key cannot be null");
151 }
152
153 if let Some(value) = find_duplicate_value(len, values) {
154 return exec_err!("map key must be unique, duplicate key found: {:?}", value);
155 }
156
157 Ok(())
158}
159
160fn find_duplicate_value<T, I>(len: usize, values: I) -> Option<T>
161where

Callers 1

validate_map_keysFunction · 0.85

Calls 1

find_duplicate_valueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…