Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Sql types SPI cleanup #24228

wants to merge 2 commits into from

Conversation

wendigo
Copy link
Contributor

@wendigo wendigo commented Nov 22, 2024

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:

## Section
* Fix some things. ({issue}`issuenumber`)

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());
Copy link
Member

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?

Copy link
Contributor Author

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.

@losipiuk
Copy link
Member

@martint any context why it was done like it was? Was that important for some reason?

@wendigo wendigo force-pushed the serafin/spi-cleanup branch 2 times, most recently from 2b75fea to aa17702 Compare November 22, 2024 19:05
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.
@wendigo wendigo force-pushed the serafin/spi-cleanup branch 2 times, most recently from 77511b5 to e52c451 Compare November 22, 2024 20:26
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants