@Override public TranslatableTable apply(final List<Object> arguments) { final RelDataType rowType; // Using an escalator here is a hack, but it's currently needed to get the row type. Ideally, some // later refactoring would make this unnecessary, since there is no actual query going out herem. final AuthenticationResult authenticationResult = escalator.createEscalatedAuthenticationResult(); try (final DruidPlanner planner = plannerFactory.createPlanner(null, authenticationResult)) { rowType = planner.plan(viewSql).rowType(); } catch (Exception e) { throw Throwables.propagate(e); } return new ViewTable( null, RelDataTypeImpl.proto(rowType), viewSql, ImmutableList.of(DruidSchema.NAME), null ); }
queryLifecycleFactory, Iterables.limit(segments, MAX_SEGMENTS_PER_QUERY), escalator.createEscalatedAuthenticationResult() );
@Override public TranslatableTable apply(final List<Object> arguments) { final RelDataType rowType; try (final DruidPlanner planner = plannerFactory.createPlanner(null)) { // Using an escalator here is a hack, but it's currently needed to get the row type. Ideally, some // later refactoring would make this unnecessary, since there is no actual query going out herem. rowType = planner.plan(viewSql, escalator.createEscalatedAuthenticationResult()).rowType(); } catch (Exception e) { throw Throwables.propagate(e); } return new ViewTable( null, RelDataTypeImpl.proto(rowType), viewSql, ImmutableList.of(DruidSchema.NAME), null ); }
queryLifecycleFactory, Iterables.limit(segments, MAX_SEGMENTS_PER_QUERY), escalator.createEscalatedAuthenticationResult() );