-
Notifications
You must be signed in to change notification settings - Fork 89
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
Add field to ThetaSketch post aggregation. Allow dimensions to be null #66
Conversation
…s to be null in GroupByQuery as they are not required
Hey @st0ckface , |
@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 |
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; |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
I see that @patilvikram already cleared that dimensions should be provided, and hence mandatory field. Thanks @patilvikram . 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. |
sure, i can make those changes. Interesting though, the druid documentation that was linked to here: Either way, I'll incorporate the feed back and push something up soon. |
...id/druidry/extensions/datasketches/postAggregator/ThetaSketchEstimatePostAggregatorTest.java
Show resolved
Hide resolved
Hey, Thanks. |
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. |
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())....