mirror of https://github.com/apache/druid.git
Removed unused planner context parameter (#13249)
Removed unused planner context parameter
This commit is contained in:
parent
acb9cb0227
commit
22c140251a
|
@ -206,11 +206,7 @@ public class DirectStatement extends AbstractStatement implements Cancelable
|
|||
try (DruidPlanner planner = sqlToolbox.plannerFactory.createPlanner(
|
||||
sqlToolbox.engine,
|
||||
queryPlus.sql(),
|
||||
queryContext,
|
||||
// Context keys for authorization. Use the user-provided keys,
|
||||
// NOT the keys from the query context which, by this point,
|
||||
// will have been extended with internally-defined values.
|
||||
queryPlus.context().keySet()
|
||||
queryContext
|
||||
)) {
|
||||
validate(planner);
|
||||
authorize(planner, authorizer());
|
||||
|
|
|
@ -68,8 +68,7 @@ public class PreparedStatement extends AbstractStatement
|
|||
try (DruidPlanner planner = sqlToolbox.plannerFactory.createPlanner(
|
||||
sqlToolbox.engine,
|
||||
queryPlus.sql(),
|
||||
queryContext,
|
||||
queryPlus.context().keySet())) {
|
||||
queryContext)) {
|
||||
validate(planner);
|
||||
authorize(planner, authorizer());
|
||||
|
||||
|
|
|
@ -113,7 +113,6 @@ public class PlannerContext
|
|||
final DruidSchemaCatalog rootSchema,
|
||||
final SqlEngine engine,
|
||||
final Map<String, Object> queryContext,
|
||||
final Set<String> contextKeys,
|
||||
final JoinableFactoryWrapper joinableFactoryWrapper
|
||||
)
|
||||
{
|
||||
|
@ -146,7 +145,6 @@ public class PlannerContext
|
|||
final DruidSchemaCatalog rootSchema,
|
||||
final SqlEngine engine,
|
||||
final Map<String, Object> queryContext,
|
||||
final Set<String> contextKeys,
|
||||
final JoinableFactoryWrapper joinableFactoryWrapper
|
||||
)
|
||||
{
|
||||
|
@ -187,7 +185,6 @@ public class PlannerContext
|
|||
rootSchema,
|
||||
engine,
|
||||
queryContext,
|
||||
contextKeys,
|
||||
joinableFactoryWrapper
|
||||
);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,6 @@ import org.apache.druid.sql.calcite.schema.DruidSchemaName;
|
|||
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
public class PlannerFactory
|
||||
{
|
||||
|
@ -105,8 +104,7 @@ public class PlannerFactory
|
|||
public DruidPlanner createPlanner(
|
||||
final SqlEngine engine,
|
||||
final String sql,
|
||||
final Map<String, Object> queryContext,
|
||||
Set<String> contextKeys
|
||||
final Map<String, Object> queryContext
|
||||
)
|
||||
{
|
||||
final PlannerContext context = PlannerContext.create(
|
||||
|
@ -118,7 +116,6 @@ public class PlannerFactory
|
|||
rootSchema,
|
||||
engine,
|
||||
queryContext,
|
||||
contextKeys,
|
||||
joinableFactoryWrapper
|
||||
);
|
||||
|
||||
|
@ -132,7 +129,7 @@ public class PlannerFactory
|
|||
@VisibleForTesting
|
||||
public DruidPlanner createPlannerForTesting(final SqlEngine engine, final String sql, final Map<String, Object> queryContext)
|
||||
{
|
||||
final DruidPlanner thePlanner = createPlanner(engine, sql, queryContext, queryContext.keySet());
|
||||
final DruidPlanner thePlanner = createPlanner(engine, sql, queryContext);
|
||||
thePlanner.getPlannerContext()
|
||||
.setAuthenticationResult(NoopEscalator.getInstance().createEscalatedAuthenticationResult());
|
||||
try {
|
||||
|
|
|
@ -61,8 +61,7 @@ public class DruidViewMacro implements TableMacro
|
|||
plannerFactory.createPlanner(
|
||||
ViewSqlEngine.INSTANCE,
|
||||
viewSql,
|
||||
Collections.emptyMap(),
|
||||
Collections.emptySet())) {
|
||||
Collections.emptyMap())) {
|
||||
planner.validate();
|
||||
rowType = planner.prepare().getValidatedRowType();
|
||||
}
|
||||
|
|
|
@ -88,9 +88,8 @@ class ExpressionTestHelper
|
|||
NamedViewSchema.NAME, new NamedViewSchema(EasyMock.createMock(ViewSchema.class))
|
||||
)
|
||||
),
|
||||
null /* Don't need engine */,
|
||||
null, /* Don't need engine */
|
||||
Collections.emptyMap(),
|
||||
Collections.emptySet(),
|
||||
JOINABLE_FACTORY_WRAPPER
|
||||
);
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ public class ExternalTableScanRuleTest
|
|||
),
|
||||
engine,
|
||||
Collections.emptyMap(),
|
||||
Collections.emptySet(),
|
||||
CalciteTests.createJoinableFactoryWrapper()
|
||||
);
|
||||
plannerContext.setQueryMaker(
|
||||
|
|
|
@ -179,7 +179,6 @@ public class CalcitePlannerModuleTest extends CalciteTestBase
|
|||
rootSchema,
|
||||
null,
|
||||
Collections.emptyMap(),
|
||||
Collections.emptySet(),
|
||||
joinableFactoryWrapper
|
||||
);
|
||||
boolean containsCustomRule = injector.getInstance(CalciteRulesManager.class)
|
||||
|
|
|
@ -95,9 +95,8 @@ public class DruidRexExecutorTest extends InitializedNullHandlingTest
|
|||
NamedViewSchema.NAME, new NamedViewSchema(EasyMock.createMock(ViewSchema.class))
|
||||
)
|
||||
),
|
||||
null /* Don't need an engine */,
|
||||
null, /* Don't need an engine */
|
||||
Collections.emptyMap(),
|
||||
Collections.emptySet(),
|
||||
CalciteTests.createJoinableFactoryWrapper()
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue