New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a compute comparator interface that doesn't bind array instances #563
Comments
Not sure this will be performant because each comparison requires a |
While looking through the hash join code from @Dandandan in DataFusion, I found another implementation of a comparator that is similar to the comparator interface proposed in this PR. It is called /// Left and right row have equal values
fn equal_rows(
left: usize,
right: usize,
left_arrays: &[ArrayRef],
right_arrays: &[ArrayRef],
) -> Result<bool> { |
There is some possibilty to use some totally different data structures too in the hash join, also to make this check more vectorized and maybe further improve efficiency and memory usage. There is some nice article and references on this blog: |
I agree -- that article is a good read (though I did find the last bits somewhat hard to follow) |
I believe this use-case is covered by the comparable row format added by #2593. Feel free to reopen if I am mistaken |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
In DataFusion we are working on a Merge operator that needs to compare multiple sorted streams of record batches, merge them together, and produce a single sorted output stream (see more context in apache/datafusion#722)
The current interface for comparing arrays in Arrow is getting a
DynComparator
Which is a function that you give two indexes and get the result. You effectively have to do
This has two problems for the merge operator:
Describe the solution you'd like
I would ideally like a comparator that does not have the array bound and instead was passed array indexes. Something like
We can probably also keep the existing interface
Describe alternatives you've considered
None
Additional context
See discussion with @Dandandan and @e-dard here: apache/datafusion#722 (comment)
The text was updated successfully, but these errors were encountered: