feat: add tuple theta implementation and tests#138
Conversation
a4fefa8 to
4f0c105
Compare
|
Thanks for your contribution @ariesdevil! I'll review this in the next week. |
a890f6d to
f75bfce
Compare
|
Based on #138 (comment) , looks like it's better to refactor ThetaHashTable, related set operation to generic version first. So that we can reuse them in tuple implementation. |
|
Fixed, PTAL again. |
| /// assert_eq!(result.num_retained(), 3); // apple, banana, cherry | ||
| /// ``` | ||
| #[derive(Debug)] | ||
| pub struct TupleUnion<S, P = DefaultUnionPolicy> { |
There was a problem hiding this comment.
This also can be ThetaUnion<E, P = DefaultUnionPolicy> and reuse between tuple and theta.
There was a problem hiding this comment.
Seems theta has no union implementation.
There was a problem hiding this comment.
Yes. I send a implementation : #145 . But it's a intermediate state for theta. I think in final we should have something like ThetaUnion<E, P = DefaultUnionPolicy> (or RawThetaUnion<E, P = DefaultUnionPolicy>) so that tuple union and theta union can reuse it in both.
In #145 I didn't implement it in this way is because we need to have RawHashTable first. 🤣
|
Thanks @ariesdevil ! This PR contains several part. How about separate this PR into smaller so that it can be more easier to review e.g.
|
Summary
Implement the Tuple sketch behind a new
tuplefeature (built on top oftheta). A Tuple sketch extends the Theta sketch by attaching a user-defined summary to every retained key, merging summaries on duplicate keys and during set operations.Summary behavior is injected externally via policies (C++-style) rather than baked into the type.
Note
This implementation is highly inspired by the C++ version.