(args: &[ArrayRef])
| 413 | } |
| 414 | |
| 415 | fn array_replace_inner(args: &[ArrayRef]) -> Result<ArrayRef> { |
| 416 | let [array, from, to] = take_function_args("array_replace", args)?; |
| 417 | |
| 418 | // replace at most one occurrence for each element |
| 419 | let arr_n = vec![1; array.len()]; |
| 420 | match array.data_type() { |
| 421 | DataType::List(_) => { |
| 422 | let list_array = array.as_list::<i32>(); |
| 423 | general_replace::<i32>(list_array, from, to, &arr_n) |
| 424 | } |
| 425 | DataType::LargeList(_) => { |
| 426 | let list_array = array.as_list::<i64>(); |
| 427 | general_replace::<i64>(list_array, from, to, &arr_n) |
| 428 | } |
| 429 | DataType::Null => Ok(new_null_array(array.data_type(), 1)), |
| 430 | array_type => exec_err!("array_replace does not support type '{array_type}'."), |
| 431 | } |
| 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)?; |
nothing calls this directly
no test coverage detected
searching dependent graphs…