Skip to content

Conversation

@aayushsh06
Copy link

Description

Adds additional formatting options for JSON by overloading the existing json_format function with a indentSpaces parameter to add formatting without impacting precision.

Additional context and related issues

json_format currently outputs compact JSON, which is hard to read in tools that display raw strings. Adding optional pretty-printing improves readability without losing precision, especially for clients like Grafana that mishandle large integers when parsing JSON. This feature is fully backward-compatible and opt-in.
Related to #27113

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@cla-bot
Copy link

cla-bot bot commented Nov 16, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@github-actions github-actions bot added the docs label Nov 16, 2025
@cla-bot
Copy link

cla-bot bot commented Nov 16, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@aayushsh06 aayushsh06 force-pushed the json-format-indentation branch from 7a66278 to 7cdb71e Compare November 23, 2025 21:49
@cla-bot
Copy link

cla-bot bot commented Nov 23, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants