From 9b31be6e74fc9f0885607fe9432a1249c6967c31 Mon Sep 17 00:00:00 2001 From: Laksh Singla Date: Tue, 26 Sep 2023 11:06:13 +0530 Subject: [PATCH] use real engine instead of mock --- .../sql/calcite/planner/CalcitePlannerModuleTest.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sql/src/test/java/org/apache/druid/sql/calcite/planner/CalcitePlannerModuleTest.java b/sql/src/test/java/org/apache/druid/sql/calcite/planner/CalcitePlannerModuleTest.java index 48e7ee2423b3..12db32d4f019 100644 --- a/sql/src/test/java/org/apache/druid/sql/calcite/planner/CalcitePlannerModuleTest.java +++ b/sql/src/test/java/org/apache/druid/sql/calcite/planner/CalcitePlannerModuleTest.java @@ -19,6 +19,7 @@ package org.apache.druid.sql.calcite.planner; +import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableSet; import com.google.inject.Guice; import com.google.inject.Injector; @@ -42,7 +43,7 @@ import org.apache.druid.sql.calcite.aggregation.SqlAggregator; import org.apache.druid.sql.calcite.expression.SqlOperatorConversion; import org.apache.druid.sql.calcite.rule.ExtensionCalciteRuleProvider; -import org.apache.druid.sql.calcite.run.SqlEngine; +import org.apache.druid.sql.calcite.run.NativeSqlEngine; import org.apache.druid.sql.calcite.schema.DruidSchemaCatalog; import org.apache.druid.sql.calcite.schema.DruidSchemaName; import org.apache.druid.sql.calcite.schema.NamedSchema; @@ -90,8 +91,6 @@ public class CalcitePlannerModuleTest extends CalciteTestBase @Mock private DruidSchemaCatalog rootSchema; - @Mock - private SqlEngine engine; private Set aggregators; private Set operatorConversions; @@ -175,10 +174,11 @@ public void testPlannerConfigIsInjected() @Test public void testExtensionCalciteRule() { + ObjectMapper mapper = new DefaultObjectMapper(); PlannerToolbox toolbox = new PlannerToolbox( injector.getInstance(DruidOperatorTable.class), macroTable, - new DefaultObjectMapper(), + mapper, injector.getInstance(PlannerConfig.class), rootSchema, joinableFactoryWrapper, @@ -189,11 +189,10 @@ public void testExtensionCalciteRule() AuthConfig.newBuilder().build() ); - PlannerContext context = PlannerContext.create( toolbox, "SELECT 1", - engine, + new NativeSqlEngine(queryLifecycleFactory, mapper), Collections.emptyMap(), null );