Repository navigation
fix: align group_concat float formatting with cast - #28700
Conversation
Use MatrixOne's canonical fixed/scientific float formatting thresholds when GROUP_CONCAT renders FLOAT and DOUBLE values.
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? |
Match the CAST-compatible formatter's negative-zero output in ordinary, DISTINCT, and prepared results. Expect the protocol's numeric BOOL result for the equality control.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed 1e60fd9 against main 06de981: approve, no concrete blocker found.
The final-emission helper matches the current CAST floatToBytes implementation: the same float64 threshold comparisons, uppercase scientific notation outside the fixed range, and the original 32/64-bit formatting precision. I checked the float32 promotion/threshold boundary specifically: CAST also promotes the value before comparing, so this does not introduce a distinct float32 cutoff. Positive/negative values, +/-zero, NaN/infinities and finite extremes follow the same formatter semantics.
Collection, typed DISTINCT/order keys, partial aggregation, spill and merge payloads are unchanged. NULL rows remain skipped; separators and the bounded writer still own truncation/warnings. Fixed-payload length validation precedes decoding, and writeBytes preserves short-write/error propagation. There is no new shared state, session dependency, protocol field or metadata type change.
Performance: per-emitted-number formatting replaces fmt formatting; the temporary text is bounded by float representation length, not group cardinality. No new accumulated buffer or sort. This fixes output compatibility with CAST, not bitwise float equality or old-worker formatting during rolling deployment.
Evidence: full diff, exact-head CAST caller/helper comparison and ordinary/ordered/DISTINCT/prepared/NULL/negative-zero/nonfinite test-oracle inspection. Validation here is source-derived; I did not run a new native suite or benchmark and did not wait for CI.
Merge Queue Status
This pull request spent 3 minutes 5 seconds in the queue, with no time running CI. Waiting for any of
All conditions
ReasonPull request #28700 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28660 ## What this PR does / why we need it: GROUP_CONCAT used Go's default float formatting, which can choose different fixed/scientific notation and exponent casing from MatrixOne's SQL CAST. As a result, aggregating a FLOAT or DOUBLE directly could differ from aggregating its CHAR conversion. Use the same notation thresholds as CAST and preserve the original float32 or float64 precision when rendering aggregate payloads. Preserve negative zero and the existing non-finite-value spelling. Aggregate storage, ordering, and DISTINCT continue to use the original typed values. Cover ordinary values, small and large exponents, negative zero, NULL, ordered/DISTINCT output, and prepared execution. Compare aggregate output with explicit CAST as an independent SQL conversion control. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28660 ## What this PR does / why we need it: GROUP_CONCAT used Go's default float formatting, which can choose different fixed/scientific notation and exponent casing from MatrixOne's SQL CAST. As a result, aggregating a FLOAT or DOUBLE directly could differ from aggregating its CHAR conversion. Use the same notation thresholds as CAST and preserve the original float32 or float64 precision when rendering aggregate payloads. Preserve negative zero and the existing non-finite-value spelling. Aggregate storage, ordering, and DISTINCT continue to use the original typed values. Cover ordinary values, small and large exponents, negative zero, NULL, ordered/DISTINCT output, and prepared execution. Compare aggregate output with explicit CAST as an independent SQL conversion control. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28660 ## What this PR does / why we need it: GROUP_CONCAT used Go's default float formatting, which can choose different fixed/scientific notation and exponent casing from MatrixOne's SQL CAST. As a result, aggregating a FLOAT or DOUBLE directly could differ from aggregating its CHAR conversion. Use the same notation thresholds as CAST and preserve the original float32 or float64 precision when rendering aggregate payloads. Preserve negative zero and the existing non-finite-value spelling. Aggregate storage, ordering, and DISTINCT continue to use the original typed values. Cover ordinary values, small and large exponents, negative zero, NULL, ordered/DISTINCT output, and prepared execution. Compare aggregate output with explicit CAST as an independent SQL conversion control. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #28660
What this PR does / why we need it:
GROUP_CONCAT used Go's default float formatting, which can choose different fixed/scientific notation and exponent casing from MatrixOne's SQL CAST. As a result, aggregating a FLOAT or DOUBLE directly could differ from aggregating its CHAR conversion.
Use the same notation thresholds as CAST and preserve the original float32 or float64 precision when rendering aggregate payloads. Preserve negative zero and the existing non-finite-value spelling. Aggregate storage, ordering, and DISTINCT continue to use the original typed values.
Cover ordinary values, small and large exponents, negative zero, NULL, ordered/DISTINCT output, and prepared execution. Compare aggregate output with explicit CAST as an independent SQL conversion control.