Add FixedSizeBinary support for MultiGroupBy#23646
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #23646 +/- ##
==========================================
+ Coverage 80.66% 80.67% +0.01%
==========================================
Files 1087 1088 +1
Lines 367409 367782 +373
Branches 367409 367782 +373
==========================================
+ Hits 296367 296726 +359
- Misses 53390 53400 +10
- Partials 17652 17656 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
There is also this PR However I don't think that will handle FixedSizeBinary |
Rich-T-kid
left a comment
There was a problem hiding this comment.
This PR looks very reasonable. I noticed that this is very similar to the ByteGroupValueBuilder implementation.
I think it would be worth it to try and see if we can modify ByteGroupValueBuilder to support similar optimizations such as batched writes. besides that vectorized/equal_to and the other trait methods are 1-1.
If ByteGroupValueBuilder cant be expanded on to include fixed size binary without extensive branching that hurts readability thats also fine.
|
|
||
| impl GroupColumn for FixedSizeBinaryGroupValueBuilder { | ||
| fn equal_to(&self, lhs_row: usize, array: &ArrayRef, rhs_row: usize) -> bool { | ||
| debug_assert!(matches!(array.data_type(), DataType::FixedSizeBinary(_))); |
There was a problem hiding this comment.
the array input is guaranteed to be the correct type. you can remove the assertion here
| rhs_rows: &[usize], | ||
| equal_to_results: &mut BooleanBufferBuilder, | ||
| ) { | ||
| debug_assert!(matches!(array.data_type(), DataType::FixedSizeBinary(_))); |
This sounds like a good thing to explore in a follow on / parallel PR |
|
Since I think the point of doing this PR is to improve performance it would be nice to have some benchmark results I created a PR with some benchmarks here Hopefully we can merge that and then use it to validate that this PR improves things |
More so that if we're grouping by a FixedSizeBinary column we run out of memory in the GroupValuesRows interning and crash :) |
e843517 to
f8ebf73
Compare
…he#23650) ## Which issue does this PR close? - Related to apache#23646 - Related to apache#23645. ## Rationale for this change The point of a specialized FixedSizeBinary group values is performance but we have no performance benchmark for it. ## What changes are included in this PR? Adds a `fixed_size_binary` experiment to `datafusion/physical-plan/benches/multi_group_by.rs` Run with: ```bash cargo bench -p datafusion-physical-plan --bench multi_group_by --features test_utils -- fixed_size_binary ``` ## Are these changes tested? This is benchmark-only. The benchmark compiles on `main` and runs end-to-end on top of apache#23646. No product code changes. ## Are there any user-facing changes? No. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Can you please merge this PR up from main (so I can run the benchmarks using the bot?) I can't do it myself b/c I don't have write permissions int he urbanlogiq repo |
done! |
3970070 to
5eb8979
Compare
Closes #23645
Rationale for this change
Multi-Group-By has cases for regular Binary/LargeBinary types, but not FixedSizeBinary
Are these changes tested?
Yes.
Are there any user-facing changes?
No