Skip to content

Send NUMBER as varchar to old clients #28144

Merged
findepi merged 2 commits intotrinodb:masterfrom
findepi:findepi/bg-client
Feb 17, 2026
Merged

Send NUMBER as varchar to old clients #28144
findepi merged 2 commits intotrinodb:masterfrom
findepi:findepi/bg-client

Conversation

@findepi
Copy link
Copy Markdown
Member

@findepi findepi commented Feb 6, 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.

--

Release notes

not for release notes yet

@cla-bot cla-bot bot added the cla-signed label Feb 6, 2026
@findepi findepi changed the title Send bigdecimal as varchar to old clients Send NUMBER as varchar to old clients Feb 16, 2026
@findepi findepi force-pushed the findepi/bg-client branch 2 times, most recently from 70adb16 to 0ca0536 Compare February 16, 2026 15:38
@findepi findepi added the no-release-notes This pull request does not require release notes entry label 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.
@findepi findepi merged commit 95b644b into trinodb:master Feb 17, 2026
196 of 198 checks passed
@findepi findepi deleted the findepi/bg-client branch February 17, 2026 08:20
@github-actions github-actions bot added this to the 480 milestone Feb 17, 2026
@ebyhr ebyhr mentioned this pull request Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

3 participants