-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialize JSON directly from Pages #23975
Conversation
eb9d704
to
f49fc78
Compare
This avoids unnecessary boxing/unboxing for primitive values which are boxed once the `Object getObjectValue` is called on a `Type`. This now fetches primitive values directly and writes them to a JsonGenerator without unboxing.
core/trino-main/src/main/java/io/trino/server/protocol/JsonBytesQueryDataProducer.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/server/protocol/JsonEncodingUtils.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine for what i can tell
This unifies serialization between the spooled and direct protocols
f49fc78
to
4c77f76
Compare
4c77f76
to
b98e65c
Compare
@@ -83,8 +83,8 @@ public ResultRows toRows(List<Column> columns, QueryData data) | |||
} | |||
|
|||
verify(columns != null && !columns.isEmpty(), "Columns must be set when decoding data"); | |||
if (data instanceof RawQueryData) { | |||
RawQueryData rawData = (RawQueryData) data; | |||
if (data instanceof TypedQueryData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we short circuit it?
if (data instanceof TypedQueryData rawData) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. This is client so JDK 8
This avoids:
Object Type.getObjectValue
calls)Description
Additional context and related issues
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: