Akshat-Jain commented on code in PR #16854:
URL: https://github.com/apache/druid/pull/16854#discussion_r1711043031
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryFrameProcessor.java:
##########
@@ -119,6 +125,20 @@ public WindowOperatorQueryFrameProcessor(
for (int i = 0; i < frameReader.signature().size(); i++) {
typeStrategies[i] =
frameReader.signature().getColumnType(i).get().getNullableStrategy();
}
+
+ // Get virtual columns to be added to the frame writer.
+ this.partitionBoostVirtualColumn = new
SettableLongVirtualColumn(QueryKitUtils.PARTITION_BOOST_COLUMN);
+ final List<VirtualColumn> frameWriterVirtualColumns = new ArrayList<>();
+ frameWriterVirtualColumns.add(partitionBoostVirtualColumn);
+
+ final VirtualColumn segmentGranularityVirtualColumn =
+ QueryKitUtils.makeSegmentGranularityVirtualColumn(jsonMapper, query);
+
+ if (segmentGranularityVirtualColumn != null) {
+ frameWriterVirtualColumns.add(segmentGranularityVirtualColumn);
+ }
+
+ this.frameWriterVirtualColumns =
VirtualColumns.create(frameWriterVirtualColumns);
Review Comment:
These lines are same in `ScanQueryFrameProcessor`, but they are different in
`GroupByPostShuffleFrameProcessor`, and not present in
`GroupByPreShuffleFrameProcessor`. So I don't see how to cleanly create a base
class for use by all frame processors.
Also, it feels unrelated to this PR changes, so we should tackle it
separately in my opinion. Would like to keep the changes affect only the
window-related layers if possible.
--
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]