array_distinct SQL function example: from list [1, 3, 2, 3, 1, 2, 4] to [1, 2, 3, 4]
(args: &[ArrayRef])
| 299 | /// array_distinct SQL function |
| 300 | /// example: from list [1, 3, 2, 3, 1, 2, 4] to [1, 2, 3, 4] |
| 301 | fn array_distinct_inner(args: &[ArrayRef]) -> Result<ArrayRef> { |
| 302 | let [array] = take_function_args("array_distinct", args)?; |
| 303 | match array.data_type() { |
| 304 | Null => Ok(Arc::clone(array)), |
| 305 | List(field) => { |
| 306 | let array = as_list_array(&array)?; |
| 307 | general_array_distinct(array, field) |
| 308 | } |
| 309 | LargeList(field) => { |
| 310 | let array = as_large_list_array(&array)?; |
| 311 | general_array_distinct(array, field) |
| 312 | } |
| 313 | arg_type => exec_err!("array_distinct does not support type {arg_type}"), |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | #[derive(Debug, PartialEq, Copy, Clone)] |
| 318 | enum SetOp { |
nothing calls this directly
no test coverage detected
searching dependent graphs…