Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when both populateResultLevelCache and grandTotal are set #7621

Closed
jihoonson opened this issue May 9, 2019 · 0 comments · Fixed by #7624
Closed

NPE when both populateResultLevelCache and grandTotal are set #7621

jihoonson opened this issue May 9, 2019 · 0 comments · Fixed by #7624
Labels
Milestone

Comments

@jihoonson
Copy link
Contributor

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.

      @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;
        };
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants