mirror of https://github.com/apache/druid.git
Fix some naming related to AggregatePullUpLookupRule. (#15677)
It was called "split" rather than "pull up" in some places. This patch standardizes on "pull up".
This commit is contained in:
parent
0457c71d03
commit
866fe1cda6
|
@ -90,14 +90,14 @@ public class QueryLookupOperatorConversion implements SqlOperatorConversion
|
||||||
false,
|
false,
|
||||||
replaceMissingValueWith,
|
replaceMissingValueWith,
|
||||||
null,
|
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
|
// 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
|
// 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.
|
// 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
|
// Note that we don't check plannerContext.isReverseLookup(), because the native layer doesn't
|
||||||
// optimize filters on RegisteredLookupExtractionFn anyway.
|
// optimize filters on RegisteredLookupExtractionFn anyway.
|
||||||
!plannerContext.isSplitLookup()
|
!plannerContext.isPullUpLookup()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -333,7 +333,7 @@ public class CalciteRulesManager
|
||||||
builder.addRuleInstance(new FilterDecomposeConcatRule());
|
builder.addRuleInstance(new FilterDecomposeConcatRule());
|
||||||
|
|
||||||
// Include rule to split injective LOOKUP across a GROUP BY.
|
// Include rule to split injective LOOKUP across a GROUP BY.
|
||||||
if (plannerContext.isSplitLookup()) {
|
if (plannerContext.isPullUpLookup()) {
|
||||||
builder.addRuleInstance(new AggregatePullUpLookupRule(plannerContext));
|
builder.addRuleInstance(new AggregatePullUpLookupRule(plannerContext));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class PlannerContext
|
||||||
public static final boolean DEFAULT_SQL_USE_BOUNDS_AND_SELECTORS = NullHandling.replaceWithDefault();
|
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 String CTX_SQL_PULL_UP_LOOKUP = "sqlPullUpLookup";
|
||||||
public static final boolean DEFAULT_SQL_PULL_UP_LOOKUP = true;
|
public static final boolean DEFAULT_SQL_PULL_UP_LOOKUP = true;
|
||||||
|
@ -120,7 +120,7 @@ public class PlannerContext
|
||||||
private final String sqlQueryId;
|
private final String sqlQueryId;
|
||||||
private final boolean stringifyArrays;
|
private final boolean stringifyArrays;
|
||||||
private final boolean useBoundsAndSelectors;
|
private final boolean useBoundsAndSelectors;
|
||||||
private final boolean splitLookup;
|
private final boolean pullUpLookup;
|
||||||
private final boolean reverseLookup;
|
private final boolean reverseLookup;
|
||||||
private final CopyOnWriteArrayList<String> nativeQueryIds = new CopyOnWriteArrayList<>();
|
private final CopyOnWriteArrayList<String> nativeQueryIds = new CopyOnWriteArrayList<>();
|
||||||
private final PlannerHook hook;
|
private final PlannerHook hook;
|
||||||
|
@ -148,7 +148,7 @@ public class PlannerContext
|
||||||
final DateTime localNow,
|
final DateTime localNow,
|
||||||
final boolean stringifyArrays,
|
final boolean stringifyArrays,
|
||||||
final boolean useBoundsAndSelectors,
|
final boolean useBoundsAndSelectors,
|
||||||
final boolean splitLookup,
|
final boolean pullUpLookup,
|
||||||
final boolean reverseLookup,
|
final boolean reverseLookup,
|
||||||
final SqlEngine engine,
|
final SqlEngine engine,
|
||||||
final Map<String, Object> queryContext,
|
final Map<String, Object> queryContext,
|
||||||
|
@ -164,7 +164,7 @@ public class PlannerContext
|
||||||
this.localNow = Preconditions.checkNotNull(localNow, "localNow");
|
this.localNow = Preconditions.checkNotNull(localNow, "localNow");
|
||||||
this.stringifyArrays = stringifyArrays;
|
this.stringifyArrays = stringifyArrays;
|
||||||
this.useBoundsAndSelectors = useBoundsAndSelectors;
|
this.useBoundsAndSelectors = useBoundsAndSelectors;
|
||||||
this.splitLookup = splitLookup;
|
this.pullUpLookup = pullUpLookup;
|
||||||
this.reverseLookup = reverseLookup;
|
this.reverseLookup = reverseLookup;
|
||||||
this.hook = hook == null ? NoOpPlannerHook.INSTANCE : hook;
|
this.hook = hook == null ? NoOpPlannerHook.INSTANCE : hook;
|
||||||
|
|
||||||
|
@ -188,14 +188,14 @@ public class PlannerContext
|
||||||
final DateTimeZone timeZone;
|
final DateTimeZone timeZone;
|
||||||
final boolean stringifyArrays;
|
final boolean stringifyArrays;
|
||||||
final boolean useBoundsAndSelectors;
|
final boolean useBoundsAndSelectors;
|
||||||
final boolean splitLookup;
|
final boolean pullUpLookup;
|
||||||
final boolean reverseLookup;
|
final boolean reverseLookup;
|
||||||
|
|
||||||
final Object stringifyParam = queryContext.get(QueryContexts.CTX_SQL_STRINGIFY_ARRAYS);
|
final Object stringifyParam = queryContext.get(QueryContexts.CTX_SQL_STRINGIFY_ARRAYS);
|
||||||
final Object tsParam = queryContext.get(CTX_SQL_CURRENT_TIMESTAMP);
|
final Object tsParam = queryContext.get(CTX_SQL_CURRENT_TIMESTAMP);
|
||||||
final Object tzParam = queryContext.get(CTX_SQL_TIME_ZONE);
|
final Object tzParam = queryContext.get(CTX_SQL_TIME_ZONE);
|
||||||
final Object useBoundsAndSelectorsParam = queryContext.get(CTX_SQL_USE_BOUNDS_AND_SELECTORS);
|
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);
|
final Object reverseLookupParam = queryContext.get(CTX_SQL_REVERSE_LOOKUP);
|
||||||
|
|
||||||
if (tsParam != null) {
|
if (tsParam != null) {
|
||||||
|
@ -222,10 +222,10 @@ public class PlannerContext
|
||||||
useBoundsAndSelectors = DEFAULT_SQL_USE_BOUNDS_AND_SELECTORS;
|
useBoundsAndSelectors = DEFAULT_SQL_USE_BOUNDS_AND_SELECTORS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (splitLookupParam != null) {
|
if (pullUpLookupParam != null) {
|
||||||
splitLookup = Numbers.parseBoolean(splitLookupParam);
|
pullUpLookup = Numbers.parseBoolean(pullUpLookupParam);
|
||||||
} else {
|
} else {
|
||||||
splitLookup = DEFAULT_SQL_PULL_UP_LOOKUP;
|
pullUpLookup = DEFAULT_SQL_PULL_UP_LOOKUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reverseLookupParam != null) {
|
if (reverseLookupParam != null) {
|
||||||
|
@ -241,7 +241,7 @@ public class PlannerContext
|
||||||
utcNow.withZone(timeZone),
|
utcNow.withZone(timeZone),
|
||||||
stringifyArrays,
|
stringifyArrays,
|
||||||
useBoundsAndSelectors,
|
useBoundsAndSelectors,
|
||||||
splitLookup,
|
pullUpLookup,
|
||||||
reverseLookup,
|
reverseLookup,
|
||||||
engine,
|
engine,
|
||||||
queryContext,
|
queryContext,
|
||||||
|
@ -378,13 +378,12 @@ public class PlannerContext
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether we should use {@link AggregatePullUpLookupRule} to split LOOKUP functions on injective lookups when they
|
* Whether we should use {@link AggregatePullUpLookupRule} to pull LOOKUP functions on injective lookups up above
|
||||||
* are dimensions in aggregations, and whether we should set the "optimize" flag on
|
* a GROUP BY.
|
||||||
* {@link RegisteredLookupExtractionFn}.
|
|
||||||
*/
|
*/
|
||||||
public boolean isSplitLookup()
|
public boolean isPullUpLookup()
|
||||||
{
|
{
|
||||||
return splitLookup;
|
return pullUpLookup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue