You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/08/13 04:43:18 UTC

[GitHub] [druid] jihoonson commented on a change in pull request #10253: Allow forceLimitPushDown in SQL

jihoonson commented on a change in pull request #10253:
URL: https://github.com/apache/druid/pull/10253#discussion_r469693037



##########
File path: processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java
##########
@@ -121,6 +120,10 @@ public static Builder builder()
   @Nullable
   private final DateTime universalTimestamp;
 
+  private final boolean canPushDownLimit;
+  @Nullable
+  private Boolean forceLimitPushDown;

Review comment:
       Yeah, it's nullable to lazily initialize and cache it. Checking the value of `forceLimitPushDown` is needed a couple of times during a query. Even though it's not very harmful, I don't see any reason to not cache it.

##########
File path: processing/src/main/java/org/apache/druid/query/groupby/GroupByQuery.java
##########
@@ -409,7 +412,10 @@ public boolean getContextSortByDimsFirst()
   @JsonIgnore
   public boolean isApplyLimitPushDown()
   {
-    return applyLimitPushDown;
+    if (forceLimitPushDown == null) {
+      forceLimitPushDown = validateAndGetForceLimitPushDown();
+    }
+    return forceLimitPushDown || canPushDownLimit;

Review comment:
       Renamed.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org