taoran92 opened a new issue, #11106:
URL: https://github.com/apache/paimon/issues/11106

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   ### Paimon version
   
   master (`530263ea4609757722ab61e564063702b7f286fa`)
   
   ### Compute Engine
   
   PyPaimon SQL CLI (`pypaimon-rust` 0.5.0), Python 3.11.
   
   ### Minimal reproduce step
   
   With the SQL dependencies installed and a valid `paimon.yaml` configured, 
run these queries separately:
   
   ```shell
   paimon sql --format json "SELECT TIMESTAMP '2026-11-11 16:13:47' AS ts;"
   
   paimon sql --format json \
     "SELECT * FROM (VALUES (CAST(9007199254740993 AS BIGINT)), (CAST(NULL AS 
BIGINT))) AS t(id);"
   ```
   
   No table creation or data writes are required.
   
   ### What doesn't meet your expectations?
   
   Expected: Both queries succeed and output valid JSON, preserving the 
timestamp and integer values and representing SQL `NULL` as JSON `null`.
   
   Actual: The TIMESTAMP query exits with code 1 and reports:
   
   ```text
   TypeError: Object of type Timestamp is not JSON serializable
   ```
   
   The same TIMESTAMP query succeeds with `--format table`.
   
   The nullable BIGINT query succeeds but outputs:
   
   ```text
   [{"id": 9007199254740992.0}, {"id": NaN}]
   ```
   
   The integer loses precision, and `NaN` is not a valid JSON value. The 
expected output is:
   
   ```json
   [{"id": 9007199254740993}, {"id": null}]
   ```
   
   ### Anything else?
   
   This also affects queries such as `SELECT * FROM demo.orders$snapshots;`, 
whose result contains a `commit_time` timestamp column.
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!
   


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

Reply via email to