This is an automated email from the ASF dual-hosted git repository.

gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 866fe1cda60 Fix some naming related to AggregatePullUpLookupRule. 
(#15677)
866fe1cda60 is described below

commit 866fe1cda60a65326baef102b2a3269b6297779a
Author: Gian Merlino <[email protected]>
AuthorDate: Fri Jan 12 15:41:58 2024 -0800

    Fix some naming related to AggregatePullUpLookupRule. (#15677)
    
    It was called "split" rather than "pull up" in some places. This patch
    standardizes on "pull up".
---
 .../builtin/QueryLookupOperatorConversion.java     |  4 +--
 .../sql/calcite/planner/CalciteRulesManager.java   |  2 +-
 .../druid/sql/calcite/planner/PlannerContext.java  | 29 +++++++++++-----------
 3 files changed, 17 insertions(+), 18 deletions(-)

diff --git 
a/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/QueryLookupOperatorConversion.java
 
b/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/QueryLookupOperatorConversion.java
index c21d14ced64..9075456c812 100644
--- 
a/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/QueryLookupOperatorConversion.java
+++ 
b/sql/src/main/java/org/apache/druid/sql/calcite/expression/builtin/QueryLookupOperatorConversion.java
@@ -90,14 +90,14 @@ public class QueryLookupOperatorConversion implements 
SqlOperatorConversion
                     false,
                     replaceMissingValueWith,
                     null,
-                    // If SplitLookupRule is disabled, then enable 
optimization at the extractionFn level, since a
+                    // If LOOKUP pull-up is disabled, then enable optimization 
at the extractionFn level, since a
                     // similar optimization may be done by the native query 
toolchests. We'd like to ensure that if
                     // people upgrade to a version where this rule was added, 
and then disable the rule due to some
                     // problem with it, they still get any optimization that 
the native layer was able to do.
                     //
                     // Note that we don't check 
plannerContext.isReverseLookup(), because the native layer doesn't
                     // optimize filters on RegisteredLookupExtractionFn anyway.
-                    !plannerContext.isSplitLookup()
+                    !plannerContext.isPullUpLookup()
                 )
             );
           } else {
diff --git 
a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java
 
b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java
index b2ba05b3049..3e62bd48bd3 100644
--- 
a/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java
+++ 
b/sql/src/main/java/org/apache/druid/sql/calcite/planner/CalciteRulesManager.java
@@ -333,7 +333,7 @@ public class CalciteRulesManager
       builder.addRuleInstance(new FilterDecomposeConcatRule());
 
       // Include rule to split injective LOOKUP across a GROUP BY.
-      if (plannerContext.isSplitLookup()) {
+      if (plannerContext.isPullUpLookup()) {
         builder.addRuleInstance(new AggregatePullUpLookupRule(plannerContext));
       }
 
diff --git 
a/sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java 
b/sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java
index 625546a4d21..b184d513fca 100644
--- a/sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java
+++ b/sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerContext.java
@@ -96,7 +96,7 @@ public class PlannerContext
   public static final boolean DEFAULT_SQL_USE_BOUNDS_AND_SELECTORS = 
NullHandling.replaceWithDefault();
 
   /**
-   * Context key for {@link PlannerContext#isSplitLookup()}.
+   * Context key for {@link PlannerContext#isPullUpLookup()}.
    */
   public static final String CTX_SQL_PULL_UP_LOOKUP = "sqlPullUpLookup";
   public static final boolean DEFAULT_SQL_PULL_UP_LOOKUP = true;
@@ -120,7 +120,7 @@ public class PlannerContext
   private final String sqlQueryId;
   private final boolean stringifyArrays;
   private final boolean useBoundsAndSelectors;
-  private final boolean splitLookup;
+  private final boolean pullUpLookup;
   private final boolean reverseLookup;
   private final CopyOnWriteArrayList<String> nativeQueryIds = new 
CopyOnWriteArrayList<>();
   private final PlannerHook hook;
@@ -148,7 +148,7 @@ public class PlannerContext
       final DateTime localNow,
       final boolean stringifyArrays,
       final boolean useBoundsAndSelectors,
-      final boolean splitLookup,
+      final boolean pullUpLookup,
       final boolean reverseLookup,
       final SqlEngine engine,
       final Map<String, Object> queryContext,
@@ -164,7 +164,7 @@ public class PlannerContext
     this.localNow = Preconditions.checkNotNull(localNow, "localNow");
     this.stringifyArrays = stringifyArrays;
     this.useBoundsAndSelectors = useBoundsAndSelectors;
-    this.splitLookup = splitLookup;
+    this.pullUpLookup = pullUpLookup;
     this.reverseLookup = reverseLookup;
     this.hook = hook == null ? NoOpPlannerHook.INSTANCE : hook;
 
@@ -188,14 +188,14 @@ public class PlannerContext
     final DateTimeZone timeZone;
     final boolean stringifyArrays;
     final boolean useBoundsAndSelectors;
-    final boolean splitLookup;
+    final boolean pullUpLookup;
     final boolean reverseLookup;
 
     final Object stringifyParam = 
queryContext.get(QueryContexts.CTX_SQL_STRINGIFY_ARRAYS);
     final Object tsParam = queryContext.get(CTX_SQL_CURRENT_TIMESTAMP);
     final Object tzParam = queryContext.get(CTX_SQL_TIME_ZONE);
     final Object useBoundsAndSelectorsParam = 
queryContext.get(CTX_SQL_USE_BOUNDS_AND_SELECTORS);
-    final Object splitLookupParam = queryContext.get(CTX_SQL_PULL_UP_LOOKUP);
+    final Object pullUpLookupParam = queryContext.get(CTX_SQL_PULL_UP_LOOKUP);
     final Object reverseLookupParam = queryContext.get(CTX_SQL_REVERSE_LOOKUP);
 
     if (tsParam != null) {
@@ -222,10 +222,10 @@ public class PlannerContext
       useBoundsAndSelectors = DEFAULT_SQL_USE_BOUNDS_AND_SELECTORS;
     }
 
-    if (splitLookupParam != null) {
-      splitLookup = Numbers.parseBoolean(splitLookupParam);
+    if (pullUpLookupParam != null) {
+      pullUpLookup = Numbers.parseBoolean(pullUpLookupParam);
     } else {
-      splitLookup = DEFAULT_SQL_PULL_UP_LOOKUP;
+      pullUpLookup = DEFAULT_SQL_PULL_UP_LOOKUP;
     }
 
     if (reverseLookupParam != null) {
@@ -241,7 +241,7 @@ public class PlannerContext
         utcNow.withZone(timeZone),
         stringifyArrays,
         useBoundsAndSelectors,
-        splitLookup,
+        pullUpLookup,
         reverseLookup,
         engine,
         queryContext,
@@ -378,13 +378,12 @@ public class PlannerContext
   }
 
   /**
-   * Whether we should use {@link AggregatePullUpLookupRule} to split LOOKUP 
functions on injective lookups when they
-   * are dimensions in aggregations, and whether we should set the "optimize" 
flag on
-   * {@link RegisteredLookupExtractionFn}.
+   * Whether we should use {@link AggregatePullUpLookupRule} to pull LOOKUP 
functions on injective lookups up above
+   * a GROUP BY.
    */
-  public boolean isSplitLookup()
+  public boolean isPullUpLookup()
   {
-    return splitLookup;
+    return pullUpLookup;
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to