(array: &dyn Array)
| 107 | } |
| 108 | |
| 109 | fn validate_unique_primitive_keys<T: ArrowPrimitiveType>(array: &dyn Array) -> Result<()> |
| 110 | where |
| 111 | T::Native: Copy + Eq + Hash + std::fmt::Display, |
| 112 | { |
| 113 | let primitive_array = array.as_primitive::<T>(); |
| 114 | if primitive_array.null_count() > 0 { |
| 115 | return exec_err!("map key cannot be null"); |
| 116 | } |
| 117 | |
| 118 | if let Some(value) = find_duplicate_value( |
| 119 | primitive_array.len(), |
| 120 | primitive_array.values().iter().copied(), |
| 121 | ) { |
| 122 | return exec_err!("map key must be unique, duplicate key found: {}", value); |
| 123 | } |
| 124 | |
| 125 | Ok(()) |
| 126 | } |
| 127 | |
| 128 | fn validate_unique_str_keys<'a>( |
| 129 | null_count: usize, |
nothing calls this directly
no test coverage detected
searching dependent graphs…