Skip to content

[python] SQL CLI JSON output fails for TIMESTAMP and loses BIGINT precision - #11107

Merged
JingsongLi merged 1 commit into
apache:masterfrom
taoran92:fix/sql-cli-json-timestamp
Nov 12, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
taoran92:fix/sql-cli-json-timestamp

Conversation

@taoran92

@taoran92 taoran92 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Purpose

Fixes #11106.

paimon sql --format json fails on TIMESTAMP results and rounds nullable BIGINT values while emitting NaN for SQL NULL. Serialize Arrow scalars directly and format timestamps as ISO 8601 strings, preserving fractional seconds and timezone offsets, including the minimum nanosecond timestamp.

Tests

  • python -m pytest -q paimon-python/pypaimon/tests/cli_sql_test.py (8 passed on each of PyArrow 16.1.0, 19.0.1, and 22.0.0).
  • Flake8 for the changed Python files.

@taoran92
taoran92 force-pushed the fix/sql-cli-json-timestamp branch from 226171f to 3a8ecf4 Compare November 12, 2026 05:06
@taoran92
taoran92 force-pushed the fix/sql-cli-json-timestamp branch from 3a8ecf4 to 14f2c0d Compare November 12, 2026 05:18
@taoran92
taoran92 marked this pull request as ready for review November 12, 2026 06:42
@JingsongLi
JingsongLi merged commit 27ae471 into apache:master Nov 12, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Python SQL CLI JSON output fails for TIMESTAMP and loses BIGINT precision

2 participants