Add regression tests for hash-join dynamic filter expression policy#23319
Draft
kosiew wants to merge 4 commits into
Draft
Add regression tests for hash-join dynamic filter expression policy#23319kosiew wants to merge 4 commits into
kosiew wants to merge 4 commits into
Conversation
…ds.rs - Added tests for `CollectLeft`: - membership only - bounds only - membership + bounds - empty/no-expression → no update - Added tests for `Partitioned`: - one real + rest empty → no CASE - multiple real → CASE, else false - all empty → false - canceled unknown + empty → CASE, else true
…sion helpers - Deduplicated test accumulator setup using `make_accumulator_for_test`. - Introduced new narrow expression helpers: `in_list_expr`, `binary_expr`, and `case_expr`. - Enhanced panic context for `current_expr` and downcasting. - Maintained existing `pub(super) make_partitioned_accumulator_for_test` without changes.
- Update CollectLeft no-expression test to assert that dynamic filter generation remains unchanged. - Improve partitioned CASE test to assert: - Routing expression is set to '%' - Branch keys are 0 and 1 - Branch expressions are verified to be InList - Fallback condition remains false
…in hash_join - Removed overlapping tests: - collect_left_combines_membership_and_bounds - partitioned_multiple_real_partitions_uses_case_with_false_fallback - partitioned_all_empty_partitions_updates_filter_to_false - Removed now-unused helper function: assert_literal_u64.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
This change adds focused regression coverage for the current dynamic-filter expression assembly performed by
SharedBuildAccumulator::build_filter. The intent is to make the existing expression policy explicit before refactoring, ensuring that future changes preserve the current pruning semantics for bothCollectLeftandPartitionedfinalize paths.What changes are included in this PR?
Add reusable test helpers for constructing
SharedBuildAccumulatorinstances, partition state, bounds, and pushdown strategies.Add unit tests covering
CollectLeftdynamic-filter expression assembly for:Add unit tests covering
Partitioneddynamic-filter expression assembly for:CASEexpression),Add helper assertions that validate the structural shape of the generated expressions (for example,
InListExpr,BinaryExpr,CaseExpr, and literal boolean expressions) rather than relying on brittle textual representations.Are these changes tested?
Yes.
This PR adds the following unit tests:
collect_left_updates_with_membership_onlycollect_left_updates_with_bounds_onlycollect_left_empty_build_data_does_not_update_filterpartitioned_one_real_partition_with_rest_empty_skips_casepartitioned_canceled_unknown_partitions_keep_unknown_routes_permissiveThese tests exercise the dynamic-filter expression policy without changing production behavior.
Are there any user-facing changes?
No. This PR only adds regression tests and does not change runtime behavior.
LLM-generated code disclosure
This PR includes LLM-generated code and comments. All LLM-generated content has been manually reviewed.