Pastoray commented on PR #427:
URL: https://github.com/apache/datafusion-spark/pull/427#issuecomment-7317213446

   Checked `%#g` against PySpark 4.2.0: Spark rejects the flag. 
`format_string('%#g', CAST(1e10 AS DOUBLE))` raises an error ("Conversion = g, 
Flags = #"), and so do `%#G`, `%#.3g` and `%#.1g`. Java 21 throws 
`FormatFlagsConversionMismatchException` for the same inputs.
   
   One precision note on the `1.e+10` example: it only happens with precision 0 
or 1. On current `main`, `%#.0g` and `%#.1g` of `1e10` print `1e+10.`, and with 
this PR they print `1.e+10`. Plain `%#g` of `1e10` prints `1.00000e+10` both 
before and after, and `%#g` of `5.0` prints `5.00000` instead of erroring. So 
the `%g` side effect here only changes the precision 0 and 1 cases, and all of 
these are wrong against Spark. A separate issue to reject `#` with `%g`/`%G` is 
the right follow-up, and this PR doesn't need to change.


-- 
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