Add unit test for not-ready Set detection in filterResultForMatchedRows#103987
Open
tiandiwonder wants to merge 2 commits intoClickHouse:masterfrom
Open
Add unit test for not-ready Set detection in filterResultForMatchedRows#103987tiandiwonder wants to merge 2 commits intoClickHouse:masterfrom
tiandiwonder wants to merge 2 commits intoClickHouse:masterfrom
Conversation
This commit adds a unit test to verify that PR ClickHouse#103029's incomplete coverage of not-ready Sets leads to a crash when the not-ready Set is in pre_actions_dag (not in filter_dag). Test: RealInOnNotReadySetWithoutCombinedGuardDiesOrThrows - Uses real FunctionIn (not test stub) - Constructs pre_actions_dag with: flag = in(lhs, not_ready_set) - Constructs filter_dag that only references flag - EXPECT_DEATH proves that without combined_dag check, real FunctionIn encounters not-ready Set and throws "Not-ready Set" exception - Validates that PR ClickHouse#103029's fix is necessary Test components: - MockNotReadyFutureSet: Forces future_set->get() == nullptr - evaluateMatchedRowsNoCombinedCheckNoCatch: Skips all checks to trigger the crash path Also exposes filterResultForMatchedRows in Utils.h for testing. Related to PR ClickHouse#103029 review: ClickHouse#103029 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
|
Workflow [PR], commit [e434b1f] Summary: ❌
AI ReviewSummaryThis PR exposes PR Metadata
Findings
ClickHouse Rules
Final Verdict
|
| @@ -0,0 +1,306 @@ | |||
| # Lessons | |||
Contributor
There was a problem hiding this comment.
This file looks like an accidental personal working note rather than part of the ANY JOIN regression test change. It adds unrelated process notes (including local absolute paths) and significantly increases PR noise.
Please remove tasks/lessons.md from this PR so the change stays focused on the intended optimizer/unit-test fix.
Change auto & to const auto & for variables that are not modified after declaration in gtest_convert_any_join.cpp. Fixes CI style check failures in PR ClickHouse#103987. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not for changelog (test improvement)
Documentation entry for user-facing changes
Summary
This PR adds regression protection for the fix in PR #103029, which addressed incomplete not-ready Set detection in
filterResultForMatchedRows.Background
PR #103029 fixed a bug where
filterResultForMatchedRowsonly checkedfilter_dagfor not-ready Sets, but evaluatedcombined_dag = merge(pre_actions_dag, filter_dag). If a not-ready Set was inpre_actions_dag, the check would be bypassed, causingFunctionInto throw aLOGICAL_ERRORexception when encountering the not-ready Set during evaluation.This PR
Adds three unit tests in
src/Processors/QueryPlan/Optimizations/tests/gtest_convert_any_join.cpp:RealInOnNotReadySetWithoutCombinedGuardDiesOrThrows (death test)
FunctionInencounters not-ready Set and throws exceptionEXPECT_DEATHto prove the exception path existsPreActionsDagNotReadySetReturnsBeforeEvaluatingFilter ⭐ (path-sensitive regression test)
FixedFilterResultForMatchedRows_ReturnsUnknown (positive test)
UNKNOWNwhenpre_actions_dagcontains not-ready SetImplementation Details
filterResultForMatchedRowsinUtils.hfor testing (follows pattern from commit 70cc74c which movedfilterResultForNotMatchedRowsfrom anonymous namespace to Utils.h)MockNotReadyFutureSettest fixtureFunctionTestNotReadySetProbewith disabled constant folding for path-sensitive testingRelated