-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Issue 4804][Schema] encode null key/value in KeyValue #6384
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
Conversation
…native/pulsar into neng/allow-null-key-value
sijie
left a comment
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.
@nlu90 can you add unit tests? It would be great to cover different serialization format as well.
| ByteBuffer byteBuffer = ByteBuffer.allocate(4 + keyBytes.length + 4 + valueBytes.length); | ||
| byteBuffer.putInt(keyBytes.length).put(keyBytes).putInt(valueBytes.length).put(valueBytes); | ||
|
|
||
| int keyEncodeLength = 1 + (null == keyBytes ? 0 : 4 + keyBytes.length); |
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 seems that it is breaking the backward compatibility. Because it introduces a new format of how key/value is stored. Can we introduce versioning to the format and use message properties to indicate which version of the forrmat that is used for serializing key/value pairs?
|
close via #7139 |
Fixes apache#4804 Thanks, @nlu90, work at apache#6384. ### Motivation Currently, the KeyValue schema doesn't handle `null` key and `null` value well.
Fixes apache#4804 Thanks, @nlu90, work at apache#6384. ### Motivation Currently, the KeyValue schema doesn't handle `null` key and `null` value well.
Fixes #4804
Motivation
Allow specifying null key or null value in KeyValue Schema
Modifications
KeyValueVerifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation