diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/view/DruidViewMacro.java b/sql/src/main/java/org/apache/druid/sql/calcite/view/DruidViewMacro.java index 9df3b669423..b92c7993883 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/view/DruidViewMacro.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/view/DruidViewMacro.java @@ -28,7 +28,6 @@ import org.apache.calcite.schema.FunctionParameter; import org.apache.calcite.schema.TableMacro; import org.apache.calcite.schema.TranslatableTable; import org.apache.calcite.schema.impl.ViewTable; -import org.apache.druid.server.security.Escalator; import org.apache.druid.sql.calcite.planner.DruidPlanner; import org.apache.druid.sql.calcite.planner.PlannerFactory; import org.apache.druid.sql.calcite.schema.DruidSchemaName; @@ -38,20 +37,17 @@ import java.util.List; public class DruidViewMacro implements TableMacro { private final PlannerFactory plannerFactory; - private final Escalator escalator; private final String viewSql; private final String druidSchemaName; @Inject public DruidViewMacro( @Assisted final PlannerFactory plannerFactory, - @Assisted final Escalator escalator, @Assisted final String viewSql, @DruidSchemaName String druidSchemaName ) { this.plannerFactory = plannerFactory; - this.escalator = escalator; this.viewSql = viewSql; this.druidSchemaName = druidSchemaName; } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/view/DruidViewMacroFactory.java b/sql/src/main/java/org/apache/druid/sql/calcite/view/DruidViewMacroFactory.java index c805b5a3359..8fd1a715e90 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/view/DruidViewMacroFactory.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/view/DruidViewMacroFactory.java @@ -19,7 +19,6 @@ package org.apache.druid.sql.calcite.view; -import org.apache.druid.server.security.Escalator; import org.apache.druid.sql.calcite.planner.PlannerFactory; /** @@ -30,5 +29,5 @@ public interface DruidViewMacroFactory /** * Creates an instance of {@link DruidViewMacro} */ - DruidViewMacro create(PlannerFactory plannerFactory, Escalator escalator, String viewSql); + DruidViewMacro create(PlannerFactory plannerFactory, String viewSql); } diff --git a/sql/src/main/java/org/apache/druid/sql/calcite/view/InProcessViewManager.java b/sql/src/main/java/org/apache/druid/sql/calcite/view/InProcessViewManager.java index f6fe9af9095..763d903e197 100644 --- a/sql/src/main/java/org/apache/druid/sql/calcite/view/InProcessViewManager.java +++ b/sql/src/main/java/org/apache/druid/sql/calcite/view/InProcessViewManager.java @@ -23,7 +23,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.inject.Inject; import org.apache.calcite.schema.TableMacro; import org.apache.druid.java.util.common.ISE; -import org.apache.druid.server.security.Escalator; import org.apache.druid.sql.calcite.planner.PlannerFactory; import java.util.Map; @@ -37,26 +36,20 @@ import java.util.concurrent.ConcurrentMap; public class InProcessViewManager implements ViewManager { private final ConcurrentMap views; - private final Escalator escalator; private final DruidViewMacroFactory druidViewMacroFactory; @Inject @VisibleForTesting - public InProcessViewManager( - final Escalator escalator, - final DruidViewMacroFactory druidViewMacroFactory - ) + public InProcessViewManager(final DruidViewMacroFactory druidViewMacroFactory) { this.views = new ConcurrentHashMap<>(); - this.escalator = escalator; this.druidViewMacroFactory = druidViewMacroFactory; } @Override public void createView(final PlannerFactory plannerFactory, final String viewName, final String viewSql) { - final TableMacro oldValue = - views.putIfAbsent(viewName, druidViewMacroFactory.create(plannerFactory, escalator, viewSql)); + final TableMacro oldValue = views.putIfAbsent(viewName, druidViewMacroFactory.create(plannerFactory, viewSql)); if (oldValue != null) { throw new ISE("View[%s] already exists", viewName); } @@ -65,8 +58,7 @@ public class InProcessViewManager implements ViewManager @Override public void alterView(final PlannerFactory plannerFactory, final String viewName, final String viewSql) { - final TableMacro oldValue = - views.replace(viewName, druidViewMacroFactory.create(plannerFactory, escalator, viewSql)); + final TableMacro oldValue = views.replace(viewName, druidViewMacroFactory.create(plannerFactory, viewSql)); if (oldValue != null) { throw new ISE("View[%s] does not exist", viewName); } diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java index 8c8704d7e99..c536faa87e1 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java @@ -972,8 +972,7 @@ public class BaseCalciteQueryTest extends CalciteTestBase ObjectMapper objectMapper ) { - final InProcessViewManager viewManager = - new InProcessViewManager(CalciteTests.TEST_AUTHENTICATOR_ESCALATOR, CalciteTests.DRUID_VIEW_MACRO_FACTORY); + final InProcessViewManager viewManager = new InProcessViewManager(CalciteTests.DRUID_VIEW_MACRO_FACTORY); DruidSchemaCatalog rootSchema = CalciteTests.createMockRootSchema( conglomerate, walker, diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDruidViewMacroFactory.java b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDruidViewMacroFactory.java index f5b110b2d66..1b043507075 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDruidViewMacroFactory.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/util/TestDruidViewMacroFactory.java @@ -19,7 +19,6 @@ package org.apache.druid.sql.calcite.util; -import org.apache.druid.server.security.Escalator; import org.apache.druid.sql.calcite.planner.PlannerFactory; import org.apache.druid.sql.calcite.view.DruidViewMacro; import org.apache.druid.sql.calcite.view.DruidViewMacroFactory; @@ -29,10 +28,9 @@ public class TestDruidViewMacroFactory implements DruidViewMacroFactory @Override public DruidViewMacro create( PlannerFactory plannerFactory, - Escalator escalator, String viewSql ) { - return new DruidViewMacro(plannerFactory, escalator, viewSql, CalciteTests.DRUID_SCHEMA_NAME); + return new DruidViewMacro(plannerFactory, viewSql, CalciteTests.DRUID_SCHEMA_NAME); } }