Brijesh-Thakkar opened a new pull request, #3018:
URL: https://github.com/apache/datafusion-comet/pull/3018
## Which issue does this PR close?
Closes #3016
## Rationale for this change
`to_json` could emit invalid JSON when encountering special floating-point
values
such as `NaN`, `+Infinity`, or `-Infinity`. These values are not valid in
JSON and
resulted in incorrect or unparsable output.
Apache Spark normalizes such values to `null` when converting to JSON. Since
DataFusion-Comet aims to be Spark-compatible, this behavior needed to be
aligned.
## What changes are included in this PR?
- Normalize `NaN`, `+Infinity`, and `-Infinity` values to `null` during
`to_json`
conversion
- Ensure `to_json` always produces valid JSON output
- Add a regression test covering special floating-point values
## How are these changes tested?
- Added a unit test verifying `to_json` behavior for `NaN`, `+Infinity`, and
`-Infinity` values
- All existing tests in the `native/spark-expr` crate pass
--
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]