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

Add field to ThetaSketch post aggregation. Allow dimensions to be null #66

Conversation

st0ckface
Copy link

Add errorBoundsStdDev to ThetaSketch postAggregation. Allow dimensions to be null in GroupByQuery as they are not required.

With dimensions needing to be NonNull, I've been writing a bunch of code like:
DruidGroupByQuery.builder().dimensions(Collections.emptyList())....

…s to be null in GroupByQuery as they are not required
@abhi-zapr
Copy link
Contributor

Hey @st0ckface ,
Thank you for your contribution.
We will review the PR by the end of the week.
Thanks.

@patilvikram
Copy link
Contributor

@st0ckface As per druid documentation, dimensions should be provided. Its mandatory field in the query. But if you found out during testing it works without dimensions you should report to druid . I believe these are dimensions used for grouping. https://druid.io/docs/latest/querying/groupbyquery.html

@st0ckface
Copy link
Author

Sure, I see that in the documentation. It works in practice, I've posted to the google group to clarify. Maybe there's a reason you wouldnt want to even if its a valid query

@@ -27,11 +28,23 @@

private DruidPostAggregator field;

@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private int errorBoundsStdDev;
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than primitive data type int and field level NON_DEFAULT annotation, change this to Integer wrapper and class level NON_NULL annotation so that we follow same convention everywhere.

public ThetaSketchEstimatePostAggregator(@NonNull String name,
@NonNull DruidPostAggregator field) {
this.type = THETA_SKETCH_ESTIMATE_POST_AGGREGATOR_TYPE;
this.name = name;
this.field = field;
}

public ThetaSketchEstimatePostAggregator(@NonNull String name,
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of two constructors, use Builder.

@abhi-zapr
Copy link
Contributor

I see that @patilvikram already cleared that dimensions should be provided, and hence mandatory field. Thanks @patilvikram .
So you should update the PR to exclude that part.

And regarding including errorBoundsStdDev field in ThetaSketchEstimatePostAggregator, thanks for contributing this. This field was not in the druid documentation and hence we didn't include. But it is there in source code, so we should include it. Update the PR to address the review comments.

Thanks.

@st0ckface
Copy link
Author

sure, i can make those changes. Interesting though, the druid documentation that was linked to here:
https://druid.io/docs/latest/querying/groupbyquery.html
Has a disclaimer at the top of the page which talks about the scenario where Time is the only grouping, in which case a timeSeriesQuery would be more appropriate. That implies that dimensions can be null, but in that case a groupByQuery is a less suitable option.

Either way, I'll incorporate the feed back and push something up soon.

@abhi-zapr
Copy link
Contributor

abhi-zapr commented Dec 15, 2018

Hey,
@st0ckface can you address the pending review comment, then we can merge your PR.

Thanks.

@abhi-zapr
Copy link
Contributor

Hey @st0ckface merging this PR in feature-branch and I will be applying test case changes required as per review comment so that we can include this patch in next release.

@abhi-zapr abhi-zapr changed the base branch from develop to thetaSketch-errorBoundsStdDev June 15, 2019 18:09
@abhi-zapr abhi-zapr merged commit d1b34bd into zapr-oss:thetaSketch-errorBoundsStdDev Jun 15, 2019
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.

3 participants