abhishekagarwal87 commented on a change in pull request #10653:
URL: https://github.com/apache/druid/pull/10653#discussion_r538620885
##########
File path:
processing/src/main/java/org/apache/druid/query/groupby/strategy/GroupByStrategyV2.java
##########
@@ -408,27 +408,10 @@ public boolean doMergeResults(final GroupByQuery query)
// Dimension spec including dimension name and output name
final List<DimensionSpec> subTotalDimensionSpec = new
ArrayList<>(dimsInSubtotalSpec.size());
final List<DimensionSpec> dimensions = query.getDimensions();
- final List<DimensionSpec> newDimensions = new ArrayList<>();
- for (int i = 0; i < dimensions.size(); i++) {
- DimensionSpec dimensionSpec = dimensions.get(i);
+ for (DimensionSpec dimensionSpec : dimensions) {
if (dimsInSubtotalSpec.contains(dimensionSpec.getOutputName())) {
- newDimensions.add(
- new DefaultDimensionSpec(
- dimensionSpec.getOutputName(),
- dimensionSpec.getOutputName(),
- dimensionSpec.getOutputType()
- )
- );
subTotalDimensionSpec.add(dimensionSpec);
- } else {
- // Insert dummy dimension so all subtotals queries have ResultRows
with the same shape.
Review comment:
https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java#L581
We are still keeping all the original dimensions in the query. So result row
size should be the same. I think you were concerned that the result should be
null for dimensions not part of the subtotal. We are not carrying over the
result for those dimensions so it should work out.
https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/query/groupby/epinephelinae/RowBasedGrouperHelper.java#L593
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]