-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
MSQ: Write summary row for GROUP BY (). #16326
Conversation
This allows us to remove "msqIncompatible()" from a couple of tests that involve GROUP BY () summary rows. To handle the case where the SQL layer drops a dimension like GROUP BY 'constant', this patch also adds a "hasDroppedDimensions" context flag to the groupBy query.
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.
Grouping#hasGroupingDimensionsDropped
accomplishes something similar like CTX_HAS_DROPPED_DIMENSIONS
, however it only lives in the SQL layer. I think we can drop hasGroupingDimensionsDropped
and use the newly added context parameter to avoid redundancy.
I think this PR also enables the following test in MSQ These are already supported by MSQ, however marked as |
@@ -537,4 +518,31 @@ private Function<Result<TimeseriesResultValue>, Result<TimeseriesResultValue>> m | |||
); | |||
}; | |||
} | |||
|
|||
public static Object[] getNullAggregations(List<AggregatorFactory> aggregatorSpecs) |
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.
nit: Javadoc
In this patch I am using |
Making this change revealed a bug in this patch:
I'm leaning towards the first one since it's technically the most correct. It sounds better to me if the combining agg of |
The first one seems better than the second one to me as well. |
This pull request has been marked as stale due to 60 days of inactivity. |
This pull request/issue has been closed due to lack of activity. If you think that |
Not stale |
have an ignored __time column.
Oops, in looking into this more, I misunderstood the problem. It was actually not this. The null-agg-frame is written with the regular aggregators, not the combining ones. The real problem is an off-by-one in updating the In the case where the query has
|
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.
Have added some comments, appreciate your inputs on them. Thanks!
...ry/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByPostShuffleFrameProcessor.java
Outdated
Show resolved
Hide resolved
...e/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java
Show resolved
Hide resolved
processing/src/main/java/org/apache/druid/query/groupby/GroupingEngine.java
Show resolved
Hide resolved
processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java
Outdated
Show resolved
Hide resolved
This pull request has been marked as stale due to 60 days of inactivity. |
This allows us to remove "msqIncompatible()" from a couple of tests that involve GROUP BY () summary rows.
To handle the case where the SQL layer drops a dimension like GROUP BY 'constant', this patch also adds a "hasDroppedDimensions" context flag to the groupBy query.