vaidik787 opened a new issue, #439:
URL: https://github.com/apache/datafusion-spark/issues/439

   **Describe the bug**
   
   `format_string` accepts the `#` flag with `%g` and `%G` and prints a number. 
Spark's `format_string` uses `java.util.Formatter`, which rejects this 
combination.
   
   **To Reproduce**
   
   ```sql
   SELECT format_string('%#g', CAST(1e10 AS DOUBLE));
   ```
   
   datafusion-spark returns `1e+10.` (or `1.e+10` once #427 lands).
   
   **Expected behavior**
   
   Java throws `FormatFlagsConversionMismatchException` for `%#g` and `%#.3g` 
(checked with `java.util.Formatter` on Java 21). Spark should raise an error 
rather than return a string. The `%#e` case is a separate bug, tracked in #423.
   
   **Additional context**
   
   Raised in the review of #427. I have not run this on PySpark, only on 
`java.util.Formatter`.


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