BufferOverflowException when querying

I am trying to run this query with my custom aggregator and I get this error:

{“error”:“Unknown exception”,“errorMessage”:“java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.nio.BufferOverflowException”,“errorClass”:“java.lang.RuntimeException”,“host”:“localhost:8083”}

``

with the corresponding broker logs:

Caused by: org.apache.druid.query.QueryInterruptedException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.nio.BufferOverflowException

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_242]

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_242]

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_242]

at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_242]

at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:125) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:227) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:135) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:383) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer.deserializeFromObject(ThrowableDeserializer.java:66) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:133) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3708) ~[jackson-databind-2.6.7.jar:2.6.7]

at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2005) ~[jackson-databind-2.6.7.jar:2.6.7]

at org.apache.druid.client.JsonParserIterator.init(JsonParserIterator.java:140) ~[druid-server-0.15.1-incubating.jar:0.15.1-incubating]

``

The query I try to run is :

{

"queryType" : "groupBy",

"dataSource" : {

  "type" : "table",

  "name" : "datasource"

},

"granularity" :  "hour",

"intervals" : [ "2019-09-09T21:00:00.000Z/2019-09-10T12:02:00.000Z" ],

"dimensions" : ["city_name"],

"aggregations" : [ {

    "fieldName": "events_num",

    "name": "events_num",

    "type": "customAggregator"

},

{

    "name" : "clicks",

    "fieldName" : "clicks",

    "type" : "longSum"

}]

}