Akshat-Jain commented on code in PR #16854:
URL: https://github.com/apache/druid/pull/16854#discussion_r1713291740


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryKit.java:
##########
@@ -122,13 +137,13 @@ public QueryDefinition makeQueryDefinition(
       queryDefBuilder.add(
           StageDefinition.builder(firstStageNumber)
                          .inputs(new StageInputSpec(firstStageNumber - 1))
-                         .signature(rowSignature)
+                         .signature(finalWindowStageRowSignature)
                          .maxWorkerCount(maxWorkerCount)
-                         .shuffleSpec(null)
+                         .shuffleSpec(finalWindowStageShuffleSpec)

Review Comment:
   @adarshsanjeev We're using the resultShuffleSpecFactory only for the last 
window stage. I'm not sure I fully understand the comment.
   
   For the final stage, we have the following cases for segmentGranularity:
   1. Granularities.ALL: We set the shuffle spec to MixShuffleSpec for the 
final window stage in this case.
   2. All other types: We create the shuffle spec using 
resultShuffleSpecFactory for the final window stage in this case.
   
   I tried running the following query as well, as suggested (IIUC):
   ```sql
   select countryName, cityName, channel, 
   row_number() over (partition by countryName order by countryName, cityName, 
channel) as c1, 
   row_number() over (partition by cityName order by countryName, cityName, 
channel) as c2
   from wikipedia
   where countryName in ('Republic of Korea', 'Austria')
   group by countryName, cityName, channel
   limit 7
   ```
   
   This query gives correct results.



-- 
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]

Reply via email to