xanderbailey opened a new pull request, #406:
URL: https://github.com/apache/datafusion-spark/pull/406

   ## Which issue does this PR close?
   
   - Part of #39 (the `%g` half; `%s` of a DECIMAL is still open).
   
   ## Rationale for this change
   
   `format_string('%g', 500.0D)` returns `500.` where Spark returns `500.000`. 
Java's `Formatter` keeps `%g`'s precision, six significant digits by default; 
we stripped the trailing zeros like C does.
   
   ## What changes are included in this PR?
   
   `%g` and `%G` no longer strip trailing zeros, for floats and decimals.
   
   ## Are these changes tested?
   
   Yes. The existing `%g` expectations in `string/format_string.slt` now keep 
their zeros, the Float32 record no longer needs its `xfail`, and new DOUBLE 
records cover `500.000`, `1234.50`, `0.000100000` and `%.3g`. The expected 
values follow Java's `Formatter`; I haven't run the PySpark runner locally, so 
CI's run checks them against Spark 4.2.
   
   ## Are there any user-facing changes?
   
   `%g` and `%G` now return Spark's result.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to