Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25511 +/- ##
========================================
Coverage 82.37% 82.38%
========================================
Files 1138 1138
Lines 434081 434322 +241
Branches 434081 434322 +241
========================================
+ Hits 357588 357814 +226
- Misses 54864 54875 +11
- Partials 21629 21633 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
There's also #25513 for the same bug |
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?
Closes #25504.
Rationale for this change
Repeated calls to a volatile higher-order UDF can reuse the first call's result. Comparing two calls can also return true without invoking the function. Both queries now execute each call.
What changes are included in this PR?
The volatility check reads the declared signature for aggregate, window and higher-order expressions, as it already does for scalar expressions. This includes aggregates used as window functions.
What is the testing strategy for this PR?
The regression registers a counter UDF and runs both queries through the SQL engine. A separate check covers all function kinds, each volatility level, and aliased expressions.
Testing Done
I used Rust 1.98.1 on macOS arm64 with the installed macOS 15.4 SDK. From the PR checkout, these commands run the same regression source against the baseline and the fix:
Raw logs
Before the fix, the projection returned:
The equality comparison returned:
After the fix, the projection returned:
The equality comparison returned:
Are there any user-facing changes?
Queries affected by the incorrect volatility check return the results of separate function calls. There is no public API change.