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

Added support for filtered aggregator #28

Merged
merged 2 commits into from
Sep 21, 2015

Conversation

se7entyse7en
Copy link
Contributor

Adds support for filtered aggregator. Usage example:

agg = filtered(Filter(dimension='label', value='impression'), count('count'))
query.groupby(datasource="kafka", granularity="minute", intervals="2015-09-01T00:00:00.000/2015-09-30T00:00:00.000", aggregations={'impressions': agg, 'evs': count('events')})

@se7entyse7en
Copy link
Contributor Author

Addresses issue #27.

if kwargs["type"] == "filtered":
kwargs["aggregator"]["name"] = name
else:
kwargs.update({"name": name})
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if this affects anything, but before, if kwarks already contained a name it would use that instead of overriding it, since we passed the name as the first key/value pair to dict(...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'm gonna check it, maybe I could also write some tests for this module in order to ensure that the change does not brake compatibility. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Of course, tests would be awesome!

@se7entyse7en
Copy link
Contributor Author

I updated the pull-request by adding some tests for the filtered aggregator. This branch is rebased on pull-request #32, so this should be done after that. I made two different pull-request so that it is possible to see that no previous behaviour is broken.

@se7entyse7en
Copy link
Contributor Author

Can someone please have a look on this?

@se7entyse7en
Copy link
Contributor Author

Rebased on master and fixed test.

@xvrl
Copy link
Member

xvrl commented Sep 21, 2015

Thanks @se7entyse7en, do you mind signing our CLA before I can merge this? You can do so here http://druid.io/community/cla.html – it also applies to metamx/pydruid

@se7entyse7en
Copy link
Contributor Author

@xvrl ok! done!

xvrl added a commit that referenced this pull request Sep 21, 2015
Added support for filtered aggregator
@xvrl xvrl merged commit 7b74ceb into druid-io:master Sep 21, 2015
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

Successfully merging this pull request may close these issues.

2 participants