Fix flaky/consistent SystemFunctionsIT.testTypeofArithmetic after int-operand widening#22416
Open
ahkcs wants to merge 3 commits into
Open
Fix flaky/consistent SystemFunctionsIT.testTypeofArithmetic after int-operand widening#22416ahkcs wants to merge 3 commits into
ahkcs wants to merge 3 commits into
Conversation
opensearch-project/sql#5603 widens narrow integer operands (byte/short/int) before +, -, * so the result cannot overflow the inferred type, which makes `int0 * 2` infer as BIGINT instead of INT. Update the typeof assertion (and its comment) to expect "BIGINT", matching the merged SQL behavior. This IT has been failing consistently on main since that grammar/lowering change landed. Test-only change. Signed-off-by: Kai Huang <ahkcs@amazon.com>
Contributor
PR Reviewer Guide 🔍(Review updated until commit 6de4aac)Here are some key observations to aid the review process:
|
…rch.org mirror; unrelated to this test-only change) Signed-off-by: Kai Huang <ahkcs@amazon.com>
Contributor
|
Persistent review updated to latest commit ae725ab |
sandeshkr419
approved these changes
Jul 8, 2026
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22416 +/- ##
============================================
- Coverage 73.50% 73.43% -0.07%
+ Complexity 76487 76463 -24
============================================
Files 6104 6104
Lines 346567 346567
Branches 49883 49883
============================================
- Hits 254733 254515 -218
- Misses 71550 71800 +250
+ Partials 20284 20252 -32 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
Persistent review updated to latest commit 6de4aac |
Contributor
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.
Description
SystemFunctionsIT.testTypeofArithmetichas been failing consistently onmain:This is an expected behavior change, not a regression. opensearch-project/sql#5603 widens narrow integer operands (byte/short/int) before
+,-,*so the result cannot overflow the inferred type. As a result,int0 * 2now infers as BIGINT instead of INT, andtypeof(int0 * 2)correctly returns"BIGINT". The QA assertion was written against the old (overflow-prone) INT inference and needs to reflect the new, correct type.Change
Update the
typeof(int0 * 2)assertion (and its comment) to expect"BIGINT". Test-only; no production code change.Testing
./gradlew ':sandbox:qa:analytics-engine-rest:integTest' --tests 'org.opensearch.analytics.qa.SystemFunctionsIT.testTypeofArithmetic'(sandbox, JDK 25).Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.