GitHub user BillLeecn opened a pull request:
https://github.com/apache/flink/pull/5516
[FLINK-8544] [Kafka Connector] Handle null message key in
JSONKeyValueDeserializationScâ¦
## What is the purpose of the change
This pull request fix a NPE thrown in JSONKeyValueDeserializationSchema
when the message key is null, allowing JSONKeyValueDeserializationSchema to be
used to retrieve message metadata even if the message key is null.
The NPE is caused by deserializing the message key without verification.
## Brief change log
- Check nullity before deserializing the message key.
## Verifying this change
This change added tests and can be verified as follows:
- Added unit tests for deserializing a message with null key.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): yes
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Yarn/Mesos, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/BillLeecn/flink flink-8544
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/5516.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5516
----
commit 385fcb60e0f9dc58523dfd54e7b3b1a50373afcf
Author: Bill Lee <bill.lee.y@...>
Date: 2018-02-17T09:50:16Z
[FLINK-8544] Handle null message key in JSONKeyValueDeserializationSchema
----
---