Skip to content

Commit

Permalink
use real engine instead of mock
Browse files Browse the repository at this point in the history
  • Loading branch information
LakshSingla committed Sep 26, 2023
1 parent fd652a7 commit 9b31be6
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -90,8 +91,6 @@ public class CalcitePlannerModuleTest extends CalciteTestBase
@Mock
private DruidSchemaCatalog rootSchema;

@Mock
private SqlEngine engine;
private Set<SqlAggregator> aggregators;
private Set<SqlOperatorConversion> operatorConversions;

Expand Down Expand Up @@ -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,
Expand All @@ -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
);
Expand Down

0 comments on commit 9b31be6

Please sign in to comment.