nozjkoitop commented on code in PR #16607:
URL: https://github.com/apache/druid/pull/16607#discussion_r1642978779
##########
processing/src/main/java/org/apache/druid/segment/serde/ComplexMetricSerde.java:
##########
@@ -115,11 +115,13 @@ public Function<Object, Long> inputSizeFn()
*/
public byte[] toBytes(@Nullable Object val)
{
- if (val != null) {
+ if (val == null) {
+ return ByteArrays.EMPTY_ARRAY;
+ } else if (val instanceof byte[]) {
+ return (byte[]) val;
+ } else {
Review Comment:
Thanks for pointing that out! It looks like this issue might not be limited
to just the HLLSketch. None of the ObjectStrategies seem to fit this scenario,
as they all expect specific objects for the toBytes() method. Using it with a
byte array directly would lead to the CCE. I'll look into why
selector.getObject is returning a byte array for a real-time segment maybe it
could be fixed there as well. It is not appears in MSQ classes directly tho, it
shows up at ComplexFieldWriter.writeTo()
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]