feat(physical-plan): Make HashTableLookupExpr serializable - #24382
feat(physical-plan): Make HashTableLookupExpr serializable#24382barbarj wants to merge 9 commits into
HashTableLookupExpr serializable#24382Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24382 +/- ##
==========================================
- Coverage 81.61% 81.58% -0.03%
==========================================
Files 1123 1123
Lines 409392 410099 +707
Branches 409392 410099 +707
==========================================
+ Hits 334134 334590 +456
- Misses 55637 55877 +240
- Partials 19621 19632 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| @@ -1291,3 +1219,28 @@ let table_opts = TableParquetOptions::try_from(&proto_table_opts)?; | |||
| ``` | |||
|
|
|||
| See [issue #24019](https://github.com/apache/datafusion/issues/24019) for details. | |||
|
|
|||
| ### `JoinHashMapType` has a new required method `hashes` | |||
There was a problem hiding this comment.
If this doesn't make it into 55.0, this will need to be moved to 55.1
|
@jayshrivastava, @barbarj, @adriangb: The deciding line between Given that, should the presence of a
|
|
I think the main thought behind the original design and split was that locally at least there's no point in building a Bloom filter if you already have a hash table in memory. It makes sense to me that if you want to serialize across the wire the tradeoff is very different, a bloom filter would be better. I'm not sure if that means you would want to build a Bloom filter upfront or build it when you serialize. |
|
My intent here was to keep the Related: #16435 |
f9d7d4e to
1329322
Compare
|
Related: bloom filters coming to spillable hash joins: #24768 |
|
@adriangb or @zhuqi-lucas Can you take a look at this? Do you have any thoughts about this approach vs waiting for bloom filters to ship with #24768 ? |
1329322 to
29a9611
Compare
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
|
I'm very much 👎🏻 on serializing the in memory map across the wire. I'm already considering a proposal to disable them by default because the current implementations are slower than no filter if the joint is not selective. Adding more additional work that happens just because the filter exists will only make this worse. |
Noted! That's instructive. If implemented, that proposal would disable the use of |
|
No, it would just turn it off by default. |
Which issue does this PR close?
Rationale for this change
In order for DataFusion Distributed (and presumably other distributed DF projects) to make use of
HashTableLookupExpras a dynamic filter across network boundaries, it needs to be serializable. (for instance, see: datafusion-contrib/datafusion-distributed#623)What changes are included in this PR?
The only sticky part of serializing
HashTableLookupExpris itsMap. The inner members of the two variants ofMap,HashMapandArrayMapboth support much more functionality than is needed to evaluate this as a dynamic expression. So, in order to simply serialization and minimize the on-wire size, we serialize only the aspects required for expression evaluation (i.e. membership checks)We replace
HashTableLookupExpr'sMapwith a local version that includes the membership-only variants. These are implemented such that they are only constructible via deserialization.Are these changes tested?
The
roundtrip_hash_table_lookup_expr_to_littest is replaced with two regular roundtrip tests, one each for theHashMapandArrayMapversions ofHashTableLookupExpr.This PR also adds a bunch of tests testing the post-deserialization behavior of the new membership-only variants.
Are there any user-facing changes?
JoinHashMapTypehas a new required methodhashes