clintropolis commented on code in PR #12855:
URL: https://github.com/apache/druid/pull/12855#discussion_r940889060


##########
processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java:
##########
@@ -556,9 +564,37 @@ public byte[] computeResultLevelCacheKey(GroupByQuery 
query)
             builder.appendStrings(subTotalSpec);
           }
         }
+        if (query.getLimitSpec() instanceof DefaultLimitSpec) {
+          DefaultLimitSpec limitSpec = (DefaultLimitSpec) query.getLimitSpec();
+          for (OrderByColumnSpec column : limitSpec.getColumns()) {
+            appendOrderingColumnCacheable(query, builder, 
column.getDimension());
+          }
+        }
         return builder.build();
       }
 
+      private void appendOrderingColumnCacheable(GroupByQuery query, 
CacheKeyBuilder builder, String sortColumn)
+      {
+        for (DimensionSpec dim : query.getDimensions()) {
+          if (sortColumn.equals(dim.getOutputName())) {
+            builder.appendCacheable(dim);

Review Comment:
   yeah that's a good point, :+1:



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