Skip to content

allow quantiles merge aggregator to also accept doubles#7718

Merged
himanshug merged 3 commits intoapache:masterfrom
clintropolis:quantiles-lenient-merge-agg
May 23, 2019
Merged

allow quantiles merge aggregator to also accept doubles#7718
himanshug merged 3 commits intoapache:masterfrom
clintropolis:quantiles-lenient-merge-agg

Conversation

@clintropolis
Copy link
Copy Markdown
Member

Fixes #7660.

This PR just does the quicker fix, modifying the merge aggregator to allow it to operate on either DoubleSketch selectors or Double selectors.

The added test triggers a failure of the form:

java.lang.ClassCastException: java.lang.Double cannot be cast to com.yahoo.sketches.quantiles.DoublesSketch

without the modification of this patch.

While investigating this issue, I have been reviewing many of the complex value aggregators, which are not incredibly consistent with each other in terms of usage/construction, but all have very similar needs: being able to build complex values, and being able to merge complex values. Refactoring to try to find a common pattern feels out of scope of fixing this issue though, so I will be hopefully revisiting this in a follow-up proposal or PR.

union.update((DoublesSketch) object);
} else {
union.update(selector.getDouble());
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would be nice to extract last 5 lines in either of the aggregator classes.

@himanshug himanshug merged commit 23e96d1 into apache:master May 23, 2019
@clintropolis clintropolis deleted the quantiles-lenient-merge-agg branch May 23, 2019 18:14
@jihoonson jihoonson added this to the 0.15.0 milestone May 23, 2019
clintropolis added a commit to clintropolis/druid that referenced this pull request May 23, 2019
* allow quantiles merge aggregator to also accept doubles

* consolidate dupe

* import
fjy pushed a commit that referenced this pull request May 24, 2019
* allow quantiles merge aggregator to also accept doubles

* consolidate dupe

* import
clintropolis added a commit to implydata/druid-public that referenced this pull request May 24, 2019
* allow quantiles merge aggregator to also accept doubles

* consolidate dupe

* import
jihoonson pushed a commit to implydata/druid-public that referenced this pull request Jun 4, 2019
…apache#7743)

* allow quantiles merge aggregator to also accept doubles

* consolidate dupe

* import
jihoonson pushed a commit to implydata/druid-public that referenced this pull request Jun 26, 2019
* allow quantiles merge aggregator to also accept doubles

* consolidate dupe

* import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quantiles sketch agg fails on inner query numeric post-agg columns

3 participants