mirror of
https://github.com/apache/druid.git
synced 2025-02-17 07:25:02 +00:00
Handle null values in KafkaStringHeaderReader
(#16192)
This commit is contained in:
parent
b0a9c318d6
commit
6e19ce5e69
@ -48,8 +48,11 @@ public class KafkaStringHeaderReader implements KafkaHeaderReader
|
||||
public List<Pair<String, Object>> read()
|
||||
{
|
||||
List<Pair<String, Object>> events = new ArrayList<>();
|
||||
|
||||
for (Header hdr : headers) {
|
||||
String s = new String(hdr.value(), this.encoding);
|
||||
byte[] value = hdr.value();
|
||||
|
||||
String s = value == null ? null : new String(value, this.encoding);
|
||||
String newKey = this.headerLabelPrefix + hdr.key();
|
||||
events.add(Pair.of(newKey, s));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user