edmondop opened a new issue, #8156:
URL: https://github.com/apache/arrow-datafusion/issues/8156
### Is your feature request related to a problem or challenge?
All these functions require fundamentally traversing row-by-row two arrays
and creating a row-by-row result, so it would be nice if we could have a single
implementation of the traversal and use a trait to inject the custom behavior
### Describe the solution you'd like
We could have something like this:
```rust
trait ArraySetOperationAccumulator<'a> {
fn new() -> Self;
fn process_left(&mut self, row: Row<'a>) -> Result<()>;
fn process_right(&mut self, row: Row<'a>) -> Result<()>;
fn rows(&self) -> &[Row<'a>];
fn clear(&mut self) -> ();
}
```
one of the problem of this implementation is the lifetime of Rows, but we
can maybe work around it if we use a .clone() on the rows and remove the
lifetime
### Describe alternatives you've considered
Duplicating the traversing code for each of these function, as it is already
happening
### Additional context
_No response_
--
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]