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

Filtered aggregations nest incorrectly #839

Open
efronbs opened this issue Nov 29, 2018 · 0 comments
Open

Filtered aggregations nest incorrectly #839

efronbs opened this issue Nov 29, 2018 · 0 comments

Comments

@efronbs
Copy link
Contributor

efronbs commented Nov 29, 2018

Currently FilteredAggregation nests incorrectly. It simply makes the filtered aggregation the inner query, and makes the outer query the aggregation it wraps without the filter. Some downstream customers have found this behavior generates erroneous nested queries. Specifically, if the wrapped aggregation relies on a fact dimension that is not grouped on, that dimension will not be exposed by the inner query making the outer query attempt to reference a dimension that doesn't exist in its context.

The fix is the call nest on the wrapped aggregation, and apply the filter to the inner query of the wrapped aggregation. the outer query of the wrapped aggregation simply becomes the outer query on the nesting that is returned (after naming has been correctly set of course)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant