You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/05/09 06:34:46 UTC

[GitHub] [incubator-druid] jihoonson opened a new issue #7621: NPE when both populateResultLevelCache and grandTotal are set

jihoonson opened a new issue #7621: NPE when both populateResultLevelCache and grandTotal are set
URL: https://github.com/apache/incubator-druid/issues/7621
 
 
   ### Affected Version
   
   All versions since 0.13.0
   
   ### Description
   
   The grandTotal doesn't have timestamp and it is filled with null in the result set. If `populateResultLevelCache` is set, the below code is executed and `input.getTimestamp().getMillis()` throws NPE.
   
   ```java
         @Override
         public Function<Result<TimeseriesResultValue>, Object> prepareForCache(boolean isResultLevelCache)
         {
           return input -> {
             TimeseriesResultValue results = input.getValue();
             final List<Object> retVal = Lists.newArrayListWithCapacity(1 + aggs.size());
   
             retVal.add(input.getTimestamp().getMillis());
             for (AggregatorFactory agg : aggs) {
               retVal.add(results.getMetric(agg.getName()));
             }
             if (isResultLevelCache) {
               for (PostAggregator postAgg : query.getPostAggregatorSpecs()) {
                 retVal.add(results.getMetric(postAgg.getName()));
               }
             }
             return retVal;
           };
         }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org