array_compact SQL function
(arg: &[ArrayRef])
| 108 | |
| 109 | /// array_compact SQL function |
| 110 | fn array_compact_inner(arg: &[ArrayRef]) -> Result<ArrayRef> { |
| 111 | let [input_array] = take_function_args("array_compact", arg)?; |
| 112 | |
| 113 | match &input_array.data_type() { |
| 114 | List(field) => { |
| 115 | let array = as_list_array(input_array)?; |
| 116 | compact_list::<i32>(array, field) |
| 117 | } |
| 118 | LargeList(field) => { |
| 119 | let array = as_large_list_array(input_array)?; |
| 120 | compact_list::<i64>(array, field) |
| 121 | } |
| 122 | Null => Ok(Arc::clone(input_array)), |
| 123 | array_type => exec_err!("array_compact does not support type '{array_type}'."), |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | /// Remove null elements from each row of a list array. |
| 128 | fn compact_list<O: OffsetSizeTrait>( |
nothing calls this directly
no test coverage detected
searching dependent graphs…