Send NUMBER as varchar to old clients #28144
Merged
findepi merged 2 commits intotrinodb:masterfrom Feb 17, 2026
Merged
Conversation
This was referenced Feb 6, 2026
fbe45cf to
4b7bcd6
Compare
70adb16 to
0ca0536
Compare
wendigo
reviewed
Feb 16, 2026
core/trino-main/src/main/java/io/trino/server/protocol/ProtocolUtil.java
Outdated
Show resolved
Hide resolved
losipiuk
reviewed
Feb 16, 2026
core/trino-main/src/main/java/io/trino/server/protocol/JsonEncodingUtils.java
Show resolved
Hide resolved
losipiuk
approved these changes
Feb 16, 2026
Trino protocol client implementation requires that any new type is send
back as a string with base64-encoded bytes. The client then decodes that
to bytes (`byte[]`), and CLI shows these in hex.
For the new high precision decimal type NUMBER, this behavior is not very
useful. Old CLI implementations show some hex digits of a string
representation. New CLI implementations unnecessarily process data with
base64.
Introduce a client capability to support `NUMBER` representation:
- old clients will get back data as `varchar`, with human-readable
representation of the value.
- new clients will get back data as `number`, with string-based
human-readable representation on the wire.
- We cannot use JSON number for transmitting the data on the wire.
This wouldn't work for Infinity and NaN values.
Even before Infinity and NaN are present in the new type, using
string-based representation is consistent with decimal on the wire
representation.
0ca0536 to
b69e7a3
Compare
wendigo
approved these changes
Feb 16, 2026
30 tasks
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trino protocol client implementation requires that any new type is send
back as a string with base64-encoded bytes. The client then decodes that
to bytes (
byte[]), and CLI shows these in hex.For the new high precision decimal type NUMBER, this behavior is not very
useful. Old CLI implementations show some hex digits of a string
representation. New CLI implementations unnecessarily process data with
base64.
Introduce a client capability to support
NUMBERrepresentation:varchar, with human-readablerepresentation of the value.
number, with string-basedhuman-readable representation on the wire.
This wouldn't work for Infinity and NaN values.
Even before Infinity and NaN are present in the new type, using
string-based representation is consistent with decimal on the wire
representation.
--
number, high precision decimal type #28120Release notes
not for release notes yet