(args: &[ArrayRef])
| 432 | } |
| 433 | |
| 434 | fn array_replace_n_inner(args: &[ArrayRef]) -> Result<ArrayRef> { |
| 435 | let [array, from, to, max] = take_function_args("array_replace_n", args)?; |
| 436 | |
| 437 | // replace the specified number of occurrences |
| 438 | let arr_n = as_int64_array(max)?.values().to_vec(); |
| 439 | match array.data_type() { |
| 440 | DataType::List(_) => { |
| 441 | let list_array = array.as_list::<i32>(); |
| 442 | general_replace::<i32>(list_array, from, to, &arr_n) |
| 443 | } |
| 444 | DataType::LargeList(_) => { |
| 445 | let list_array = array.as_list::<i64>(); |
| 446 | general_replace::<i64>(list_array, from, to, &arr_n) |
| 447 | } |
| 448 | DataType::Null => Ok(new_null_array(array.data_type(), 1)), |
| 449 | array_type => { |
| 450 | exec_err!("array_replace_n does not support type '{array_type}'.") |
| 451 | } |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | fn array_replace_all_inner(args: &[ArrayRef]) -> Result<ArrayRef> { |
| 456 | let [array, from, to] = take_function_args("array_replace_all", args)?; |
nothing calls this directly
no test coverage detected
searching dependent graphs…