gianm commented on code in PR #13206:
URL: https://github.com/apache/druid/pull/13206#discussion_r992786514


##########
sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java:
##########
@@ -1219,10 +1280,22 @@ private GroupByQuery toGroupByQuery()
         }
         queryGranularity = granularity;
         int timestampDimensionIndexInDimensions = 
grouping.getDimensions().indexOf(dimensionExpression);
-        // these settings will only affect the most inner query sent to the 
down streaming compute nodes
-        theContext.put(GroupByQuery.CTX_TIMESTAMP_RESULT_FIELD, 
dimensionExpression.getOutputName());
-        theContext.put(GroupByQuery.CTX_TIMESTAMP_RESULT_FIELD_INDEX, 
timestampDimensionIndexInDimensions);
-        theContext.put(GroupByQuery.CTX_TIMESTAMP_RESULT_FIELD_GRANULARITY, 
queryGranularity);
+
+        if (canUseQueryGranularity(dataSource, filtration, queryGranularity)) {

Review Comment:
   Given the code structure, I think it's OK, but I rearranged it a bit anyway 
to hopefully make the logic clearer.



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