hangc0276 opened a new pull request #8140:
URL: https://github.com/apache/pulsar/pull/8140
Fix #7657
### Motivation
In `GenericJsonRecord.java`, it deserialize byte to String.
```
public Object getField(String fieldName) {
JsonNode fn = jn.get(fieldName);
if (fn.isContainerNode()) {
AtomicInteger idx = new AtomicInteger(0);
List<Field> fields = Lists.newArrayList(fn.fieldNames())
.stream()
.map(f -> new Field(f, idx.getAndIncrement()))
.collect(Collectors.toList());
return new GenericJsonRecord(schemaVersion, fields, fn);
} else if (fn.isBoolean()) {
return fn.asBoolean();
} else if (fn.isFloatingPointNumber()) {
return fn.asDouble();
} else if (fn.isBigInteger()) {
if (fn.canConvertToLong()) {
return fn.asLong();
} else {
return fn.asText();
}
} else if (fn.isNumber()) {
return fn.numberValue();
} else {
return fn.asText();
}
}
```
### Changes
Add check the jsonNode binary type and convert to binaryValue instead of
`asText`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]