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

Fix StandardDeviationPostAggregator to account for null return values from the NoopAggregator #15660

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

LakshSingla
Copy link
Contributor

Description

Fixes NPE which can arise if the StandardDeviationPostAggregator is passed in null. This adds a check to make sure that the object is the desired type before casting.

The following query fails before the patch, however, please post it.

{
  "queryType": "groupBy",
  "dataSource": {
    "type": "table",
    "name": "wikipedia"
  },
  "intervals": {
    "type": "intervals",
    "intervals": [
      "1998-01-09T23:55:00.000Z/1999-01-10T00:55:00.000Z"
    ]
  },
  "granularity": {
    "type": "all"
  },
  "dimensions": [],
  "aggregations": [
    {
      "type": "variance",
      "name": "preAggregationValue",
      "fieldName": "commentLength",
      "estimator": null,
      "inputType": "float"
    }
  ],
  "postAggregations": [
    {
      "type": "stddev",
      "name": "value",
      "fieldName": "preAggregationValue",
      "estimator": null
    }
  ],
  "limitSpec": {
    "type": "NoopLimitSpec"
  },
  "context": {
    "enableTimeBoundaryPlanning": "true",
    "useCache": true,
    "debug":true
  }
}

Key changed/added classes in this PR
  • MyFoo
  • OurBar
  • TheirBaz

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@abhishekagarwal87 abhishekagarwal87 merged commit 8ba06cf into apache:master Jan 16, 2024
53 checks passed
@adarshsanjeev adarshsanjeev added this to the 30.0.0 milestone May 6, 2024
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 this pull request may close these issues.

4 participants