LakshSingla commented on code in PR #15470:
URL: https://github.com/apache/druid/pull/15470#discussion_r1534632441
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/groupby/GroupByQueryKit.java:
##########
@@ -62,6 +65,25 @@ public GroupByQueryKit(ObjectMapper jsonMapper)
this.jsonMapper = jsonMapper;
}
+ /**
+ * Intermediate signature of a particular {@link GroupByQuery}. Does not
include post-aggregators, and all
+ * aggregations are nonfinalized.
+ */
+ private static RowSignature computeIntermediateSignature(final GroupByQuery
query)
+ {
+ final RowSignature postAggregationSignature =
query.getResultRowSignature(RowSignature.Finalization.NO);
+ final RowSignature.Builder builder = RowSignature.builder();
+
+ for (int i = 0; i < query.getResultRowSizeWithoutPostAggregators(); i++) {
+ builder.add(
+ postAggregationSignature.getColumnName(i),
+ postAggregationSignature.getColumnType(i).orElse(null)
+ );
+ }
Review Comment:
This assumes that the post aggregations are at the end of the result
signature. I don't think there's a contract which has that. I think something
more reliable could be:
```java
for (col : rowSignature) {
if (colName not in query.getPostAggregators()) {
builder.add()
}
}
```
--
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]