Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.32.0
Description
Adding the following unit test to JdbcAdapterTest causes an NullPointerException
@Test void testBatchNestedLoopJoin() { CalciteAssert.that() .with(CalciteConnectionProperty.LEX, Lex.JAVA) .with(CalciteConnectionProperty.FORCE_DECORRELATE, false) .withSchema("s", new ReflectiveSchema(new HrSchema())) .withModel(FoodmartSchema.FOODMART_MODEL) .query("select e.name from emps e join foodmart.store x on e.deptno = x.store_id") .withHook(Hook.PLANNER, (Consumer<RelOptPlanner>) planner -> { planner.removeRule(EnumerableRules.ENUMERABLE_CORRELATE_RULE); planner.addRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE); }) .runs(); }
Error while executing SQL "select e.name from emps e join foodmart.store x on e.deptno = x.store_id": Unable to implement EnumerableCalc(expr#0..2=[{inputs}], name=[$t0]): rowcount = 375.0, cumulative cost = {1465.0 rows, 2968.0 cpu, 0.0 io}, id = 174 EnumerableBatchNestedLoopJoin(condition=[=($1, $2)], joinType=[inner], variablesSet=[[$cor0, ... $cor99]], batchSize=[100]): rowcount = 375.0, cumulative cost = {1090.0 rows, 1468.0 cpu, 0.0 io}, id = 170 EnumerableCalc(expr#0..4=[{inputs}], expr#5=[CAST($t1):INTEGER NOT NULL], name=[$t2], deptno0=[$t5]): rowcount = 100.0, cumulative cost = {200.0 rows, 901.0 cpu, 0.0 io}, id = 176 EnumerableTableScan(table=[[s, emps]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 52 JdbcToEnumerableConverter: rowcount = 25.0, cumulative cost = {207.5 rows, 283.5 cpu, 0.0 io}, id = 168 JdbcFilter(condition=[OR(=($cor0.deptno0, $0), ...)]): rowcount = 25.0, cumulative cost = {205.0 rows, 281.0 cpu, 0.0 io}, id = 166 JdbcProject(store_id=[$0]): rowcount = 100.0, cumulative cost = {180.0 rows, 181.0 cpu, 0.0 io}, id = 164 JdbcTableScan(table=[[foodmart, store]]): rowcount = 100.0, cumulative cost = {100.0 rows, 101.0 cpu, 0.0 io}, id = 3 ... Suppressed: java.lang.NullPointerException: variable $cor0 is not found
Attachments
Issue Links
- duplicates
-
CALCITE-4188 support EnumerableBatchNestedLoopJoin in JdbcToEnumerableConverter implement
- Open
- links to