-
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
Sql types SPI cleanup #24228
base: master
Are you sure you want to change the base?
Sql types SPI cleanup #24228
Conversation
6d45b66
to
3f2cb77
Compare
case SqlVarbinary varbinary -> generator.writeFieldName(Base64.getEncoder().encodeToString(varbinary.getBytes())); | ||
case Object value -> generator.writeFieldName(value.toString()); | ||
} | ||
generator.writeFieldName(mapType.getKeyType().getObjectValue(session, keyBlock, offset + i).toString()); |
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.
Comment above mentions backward compatibility. But we are changing how it works just know. Is that commment even important at all?
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.
It is, JSON v1 format always serializes key to a String, even if it is a map or list.
@martint any context why it was done like it was? Was that important for some reason? |
2b75fea
to
aa17702
Compare
Other Sql* classes are serialized to JSON on-the-wire format, using @JsonValue annotated toString methods, except for SqlVarbinary which was serialized using its' getBytes() method that was Base64-encoded to a map key.
77511b5
to
e52c451
Compare
The new JSON serialization is not using ObjectMapper to serialize these values anymore. We want to decouple SPI types from JSON representation to be able to introduce alternative encoding formats.
e52c451
to
e4ba2d5
Compare
Description
Additional context and related issues
Release notes
( ) 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: