Repository navigation
Fix JSON numeric comparisons beyond FLOAT range - #32092
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 8bd475530ba03fca6f9abec32cc1d2da2faca1a5
Assessment: approve
No actionable defects found. The fix reuses the existing converter, separates JSON-row conversion from peer validation, and preserves in-range FLOAT32 rounding and explicit CAST errors.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed all six changed files, complete discussion, seven linked-issue comments, and direct/prepared comparison consumers.
-
Frozen-head CI reports successful build, UT, SCA, coverage and both BVT groups.
-
Static audit passed; source-audit.log and checks/1793713749112378622-2.json confirm matching frozen source, whitespace checks and complete discussion coverage.
Limitations:
-
No local product tests were run; execution evidence comes from supplied CI and author reports.
-
MySQL FLOAT32-adjacent comparisons and FLOAT performance were not independently measured.
✅ Merged into
|
…5cbbc7a29cc73b008580ec0fb63ba3a8d30c0d1
…loats unrounded matrixorigin#32092 compares a JSON number outside FLOAT's range by its float64 value instead of failing. Apply the same to bf16/float16/float8/float4: inside the type's finite range the JSON number is rounded to the type's grid as before, outside it compares unrounded. The numeric peer keeps its range check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
What type of PR is this?
Which issue(s) this PR fixes:
What this PR does / why we need it:
Comparing a valid JSON number such as
1e100with a FLOAT currently fails the whole query when the JSON value exceeds the FLOAT32 range. Compare out-of-range JSON values using their FLOAT64 value while preserving FLOAT32 rounding inside its range and the existing validation of the FLOAT peer. Explicit CAST behavior remains unchanged.This follows up on #31719, which removed the integer-domain restriction but retained the FLOAT32 range check.
Validation
function/func_json_extract.test: 364/364 twice; ASOF: 74/74; join: 1254/1254 on a single-node instance.1e100equality case in both directions. MySQL FLOAT32 adjacent values were not measured, and no FLOAT performance benchmark was run. CI remains pending.CI repair validation (8bd4755)
The coverage failure at
840bed3237960971b9c03eb62ef47ac52f820a8awas reproduced locally:TestPreparedJSONComparisonSelectionstill expected JSON1e100versus FLOAT to fail. Updated that consumer oracle to assert nonmatching results for positive/negative out-of-range JSON values, selected rows, and FLOAT → DOUBLE → FLOAT rebinding. Product code is unchanged by this repair.New validation on Darwin/arm64, Go 1.27.1 at
8bd475530ba03fca6f9abec32cc1d2da2faca1a5:mo-cgo-test -count=1 -timeout=120s -short -tags matrixone_test -covermode=set -run '^TestPreparedJSONComparisonSelection$' -v ./pkg/sql/colexec: passed.mo-cgo-test -count=1 -timeout=240s ./pkg/sql/colexec ./pkg/sql/plan/function: both full packages passed.go vet -mod=readonlyand incrementalgolangci-lint run --new-from-rev c337122982537dcf957705cb6fc5f7f9bdc6a0f6for those two packages, with repository CGo inputs: passed (0 lint issues).The earlier SQL/BVT results above are reused because product code and BVT inputs did not change. Linux/x64 CI for this repair remains pending; the failed old run is not rerun.