sql/src/main/java/org/apache/druid/sql/calcite/planner/PlannerFactory.java
/**
   * Not just visible for, but only for testing. Create a planner pre-loaded with an escalated authentication result
   * and ready to go authorization result.
   */
Not just visible for, but only for testing. Create a planner pre-loaded with an escalated authentication result
and ready to go authorization result.
Not just visible for but only for testing . Create a planner pre - loaded with an escalated authentication result and ready to go authorization result .
@VisibleForTesting
  public DruidPlanner createPlannerForTesting(final Map<String, Object> queryContext, String query)
  {
    final DruidPlanner thePlanner = createPlanner(query, new QueryContext(queryContext));
    thePlanner.getPlannerContext()
              .setAuthenticationResult(NoopEscalator.getInstance().createEscalatedAuthenticationResult());
    try {
      thePlanner.validate(false);
    }
    catch (SqlParseException | ValidationException e) {
      throw new RuntimeException(e);
    }
    thePlanner.getPlannerContext().setAuthorizationResult(Access.OK);
    return thePlanner;
  }
@ VisibleForTesting public DruidPlanner createPlannerForTesting ( final Map < String , Object > queryContext , String query ) { final DruidPlanner thePlanner = createPlanner ( query , new QueryContext ( queryContext ) ) ; thePlanner . getPlannerContext ( ) . setAuthenticationResult ( NoopEscalator . getInstance ( ) . createEscalatedAuthenticationResult ( ) ) ; try { thePlanner . validate ( false ) ; } catch ( SqlParseException | ValidationException e ) { throw new RuntimeException ( e ) ; } thePlanner . getPlannerContext ( ) . setAuthorizationResult ( Access . OK ) ; return thePlanner ; }
Not just visible for, but only for testing.
Not just visible for but only for testing .