alamb commented on code in PR #1608:
URL: https://github.com/apache/arrow-rs/pull/1608#discussion_r857527231
##########
arrow/src/compute/kernels/substring.rs:
##########
@@ -25,7 +26,68 @@ use crate::{
};
use std::cmp::Ordering;
-fn generic_substring<OffsetSize: StringOffsetSizeTrait>(
+fn binary_substring<OffsetSize: BinaryOffsetSizeTrait>(
Review Comment:
Rather than replicate quite so much code, I wonder if it would be possible
to make `generic_substring` take a function to check char boundaries and and
then pass in a function that does nothing
Maybe like(untested):
```rust
fn generic_substring<OffsetSize, F>(
array: &GenericBinaryArray<OffsetSize>,
start: OffsetSize,
length: Option<OffsetSize>,
check_char_boundary: F,
)
where
OffsetSize: StringOffsetSizeTrait,
F: Fn(OffsetSize) -> Result<OffsetSize>
{
...
}
--
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]