Fix SystemFunctionsIT.testTypeofArithmetic for int-operand widening - #22466
Conversation
PR Reviewer Guide 🔍(Review updated until commit 4ac064f)Here are some key observations to aid the review process:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22466 +/- ##
============================================
- Coverage 73.43% 73.41% -0.03%
+ Complexity 76472 76452 -20
============================================
Files 6104 6104
Lines 346573 346573
Branches 49886 49886
============================================
- Hits 254514 254435 -79
- Misses 71798 71925 +127
+ Partials 20261 20213 -48 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Persistent review updated to latest commit 7defc3e |
|
Persistent review updated to latest commit 594ed79 |
|
❌ Gradle check result for 594ed79: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 8821e4b |
|
❌ Gradle check result for 8821e4b: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 7b7b2bf |
|
Persistent review updated to latest commit ec0e9a8 |
|
❌ Gradle check result for ec0e9a8: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit aa6f7cd |
|
Persistent review updated to latest commit fcef072 |
|
❌ Gradle check result for fcef072: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit a3af830 |
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> Update plan shape goldens for int-operand widening to BIGINT The int-operand widening fix (aa6f7cd) changed arithmetic expressions to cast integer operands to BIGINT before addition or subtraction. Update the q30 and q36 golden files to reflect the new plan shapes in both logical (nested ANNOTATED_PROJECT_EXPR with CAST(:BIGINT)) and physical (Int32 → Int64, CAST(... AS Int64)) layers. Signed-off-by: Somesh Gupta <guptasom@amazon.com>
|
Persistent review updated to latest commit 4ac064f |
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.