Akshat-Jain commented on code in PR #16854:
URL: https://github.com/apache/druid/pull/16854#discussion_r1719363671
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryKit.java:
##########
@@ -105,8 +108,20 @@ public QueryDefinition makeQueryDefinition(
final int firstStageNumber = Math.max(minStageNumber,
queryDefBuilder.getNextStageNumber());
final WindowOperatorQuery queryToRun = (WindowOperatorQuery)
originalQuery.withDataSource(dataSourcePlan.getNewDataSource());
- final int maxRowsMaterialized;
+ // Get segment granularity from query context, and create ShuffleSpec and
RowSignature to be used for the final window stage.
+ final Granularity segmentGranularity =
QueryKitUtils.getSegmentGranularityFromContext(jsonMapper,
queryToRun.getContext());
+ final ClusterBy finalWindowClusterBy =
QueryKitUtils.clusterByWithSegmentGranularity(ClusterBy.none(),
segmentGranularity);
Review Comment:
I've pushed some logic changes as per offline discussion. Please have a
look, will close this comment as it's outdated now. Thanks!
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryKit.java:
##########
@@ -105,8 +108,20 @@ public QueryDefinition makeQueryDefinition(
final int firstStageNumber = Math.max(minStageNumber,
queryDefBuilder.getNextStageNumber());
final WindowOperatorQuery queryToRun = (WindowOperatorQuery)
originalQuery.withDataSource(dataSourcePlan.getNewDataSource());
- final int maxRowsMaterialized;
+ // Get segment granularity from query context, and create ShuffleSpec and
RowSignature to be used for the final window stage.
+ final Granularity segmentGranularity =
QueryKitUtils.getSegmentGranularityFromContext(jsonMapper,
queryToRun.getContext());
+ final ClusterBy finalWindowClusterBy =
QueryKitUtils.clusterByWithSegmentGranularity(ClusterBy.none(),
segmentGranularity);
+ ShuffleSpec finalWindowStageShuffleSpec =
resultShuffleSpecFactory.build(finalWindowClusterBy, false);
+ if (Objects.equals(segmentGranularity, Granularities.ALL)) {
+ finalWindowStageShuffleSpec = MixShuffleSpec.instance();
+ }
Review Comment:
I've pushed some logic changes as per offline discussion. Please have a
look, will close this comment as it's outdated now. Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]