alamb commented on code in PR #9838:
URL: https://github.com/apache/arrow-rs/pull/9838#discussion_r3149835016
##########
arrow-string/src/length.rs:
##########
@@ -22,6 +22,20 @@ use arrow_array::{cast::AsArray, types::*};
use arrow_buffer::{ArrowNativeType, NullBuffer, OffsetBuffer};
use arrow_schema::{ArrowError, DataType};
use std::sync::Arc;
+macro_rules! ree_length {
+ ($array:expr, $run_type:ty, $k:expr, $v:expr) => {{
+ let ree = $array.as_run_opt::<$run_type>().unwrap();
+ let inner_value_lengths = length(ree.values().as_ref())?;
Review Comment:
this pattern of 'replaces the values of the REE array' is probably common
enough to warrant its own function on RunArray eventually. Maybe some thing
like
```rust
let out_ree = ree.with_new_values(inner_value_lengths)
```
And then internally it can update the data type and that the number of inner
values is correct 🤔
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]