Class ResultRowObjectMapperDecoratorUtil

java.lang.Object
org.apache.druid.query.groupby.ResultRowObjectMapperDecoratorUtil

public class ResultRowObjectMapperDecoratorUtil extends Object
Utility class for conditional serde of ResultRow objects. Depending on the query configuration and the query dimensions, this class chooses an optimally performant method for serdeing the result rows while also preserving the dimension classes. Any modification this class must be benchmarked properly as it runs in a hot-loop and can have significant impact on long-running queries. See GroupByDeserializationBenchmark for existing benchmarks
  • Constructor Details

    • ResultRowObjectMapperDecoratorUtil

      public ResultRowObjectMapperDecoratorUtil()
  • Method Details

    • decorateObjectMapper

      public static com.fasterxml.jackson.databind.ObjectMapper decorateObjectMapper(com.fasterxml.jackson.databind.ObjectMapper baseObjectMapper, GroupByQuery query, GroupByQueryConfig groupByQueryConfig)
      Decorates the provided object mapper so that it can read the result rows generated by the given query and the groupByQueryConfig. It never modifies the provided object mapper. It can either return the same mapper undecorated, or clones the object mapper before decorating it.