Skip to content

Fix JSON numeric comparisons beyond FLOAT range - #32092

Merged
mergify[bot] merged 5 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/d15f10cf77ecb9d3b07039f975cbbc7a29cc73b008580ec0fb63ba3a8d30c0d1
Nov 3, 2026
Merged

mergify[bot] merged 5 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/d15f10cf77ecb9d3b07039f975cbbc7a29cc73b008580ec0fb63ba3a8d30c0d1

Conversation

@iamlinjunhong

@iamlinjunhong iamlinjunhong commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

What this PR does / why we need it:

Comparing a valid JSON number such as 1e100 with 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

  • Focused JSON numeric and direct/prepared comparison unit tests; full function Go package, vet and lint passed on the same product code.
  • function/func_json_extract.test: 364/364 twice; ASOF: 74/74; join: 1254/1254 on a single-node instance.
  • The full function directory exited with 105 failures in four cases that hard-code port 6001 while the test instance used 37101. With only those case ports changed in temporary copies, all 166/166 assertions in those four cases passed. The original directory run did not pass.
  • Historical MySQL 8.0.45 comparisons covered the reported 1e100 equality 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 840bed3237960971b9c03eb62ef47ac52f820a8a was reproduced locally: TestPreparedJSONComparisonSelection still expected JSON 1e100 versus 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=readonly and incremental golangci-lint run --new-from-rev c337122982537dcf957705cb6fc5f7f9bdc6a0f6 for 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.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 8bd475530ba03fca6f9abec32cc1d2da2faca1a5

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mergify mergify Bot added the queued label Nov 3, 2026
@mergify

mergify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as 8aa69be at 16:18 UTC

2 h 28 min in the queue, 1 h 5 min of it CI.

So far

  • ✅ Entered the queue Tue 3 Nov, 13:50 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Passed · in place
  • ✅ Merged 16:18 · 8aa69be · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot merged commit 8aa69be into matrixorigin:main Nov 3, 2026
@mergify mergify Bot removed the queued label Nov 3, 2026
cpegeric added a commit to cpegeric/matrixone that referenced this pull request Nov 3, 2026
…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]>

This branch was previously deployed

1 inactive deployment
ci — 89bfcdb7 Deployed Nov 3, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants