[jira] [Commented] (CALCITE-5409) Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE

2023-12-21 Thread Ulrich Kramer (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-5409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17799475#comment-17799475
 ] 

Ulrich Kramer commented on CALCITE-5409:


Sorry for reopening this issue. It's really a duplicate of CALCITE-4188.

I will close this ticket and add my PR to CALCITE-4188.



> Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE
> ---
>
> Key: CALCITE-5409
> URL: https://issues.apache.org/jira/browse/CALCITE-5409
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.32.0
>Reporter: Ulrich Kramer
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.33.0
>
>
> Adding the following unit test to {{JdbcAdapterTest}} causes an 
> {{NullPointerException}}
> {code:java}
>   @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) planner -> {
>   planner.removeRule(EnumerableRules.ENUMERABLE_CORRELATE_RULE);
>   
> planner.addRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE);
> })
> .runs();
>   }
> {code}
> {code}
> 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
> {code}
> See also https://issues.apache.org/jira/browse/CALCITE-5354



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-5409) Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE

2023-12-21 Thread Stamatis Zampetakis (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-5409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17799471#comment-17799471
 ] 

Stamatis Zampetakis commented on CALCITE-5409:
--

This was previously tagged as a duplicate of CALCITE-4188. The original ticket 
had quite a bit of history behind it so not sure why this issue was reopened. 

[~kramerul] Is this different from CALCITE-4188? If not then we should continue 
the discussion there so other people tracking it can participate as well.

FYI: I had a first look at PR#3562 but didn't fully got how things work. I am 
missing the big picture so need to spend more time on it. Will try to go over 
it again in the next days.

> Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE
> ---
>
> Key: CALCITE-5409
> URL: https://issues.apache.org/jira/browse/CALCITE-5409
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.32.0
>Reporter: Ulrich Kramer
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.33.0
>
>
> Adding the following unit test to {{JdbcAdapterTest}} causes an 
> {{NullPointerException}}
> {code:java}
>   @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) planner -> {
>   planner.removeRule(EnumerableRules.ENUMERABLE_CORRELATE_RULE);
>   
> planner.addRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE);
> })
> .runs();
>   }
> {code}
> {code}
> 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
> {code}
> See also https://issues.apache.org/jira/browse/CALCITE-5354



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-5409) Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE

2023-12-19 Thread Ulrich Kramer (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-5409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17798492#comment-17798492
 ] 

Ulrich Kramer commented on CALCITE-5409:


Hi [~zabetak],

could you have a look at my PR? Is something missing?

> Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE
> ---
>
> Key: CALCITE-5409
> URL: https://issues.apache.org/jira/browse/CALCITE-5409
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.32.0
>Reporter: Ulrich Kramer
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.33.0
>
>
> Adding the following unit test to {{JdbcAdapterTest}} causes an 
> {{NullPointerException}}
> {code:java}
>   @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) planner -> {
>   planner.removeRule(EnumerableRules.ENUMERABLE_CORRELATE_RULE);
>   
> planner.addRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE);
> })
> .runs();
>   }
> {code}
> {code}
> 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
> {code}
> See also https://issues.apache.org/jira/browse/CALCITE-5354



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-5409) Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE

2022-11-30 Thread Ruben Q L (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-5409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17641428#comment-17641428
 ] 

Ruben Q L commented on CALCITE-5409:


Thanks for the clarification.

> Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE
> ---
>
> Key: CALCITE-5409
> URL: https://issues.apache.org/jira/browse/CALCITE-5409
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.32.0
>Reporter: Ulrich Kramer
>Priority: Major
> Fix For: 1.33.0
>
>
> Adding the following unit test to {{JdbcAdapterTest}} causes an 
> {{NullPointerException}}
> {code:java}
>   @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) planner -> {
>   planner.removeRule(EnumerableRules.ENUMERABLE_CORRELATE_RULE);
>   
> planner.addRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE);
> })
> .runs();
>   }
> {code}
> {code}
> 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
> {code}
> See also https://issues.apache.org/jira/browse/CALCITE-5354



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-5409) Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE

2022-11-30 Thread Stamatis Zampetakis (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-5409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17641423#comment-17641423
 ] 

Stamatis Zampetakis commented on CALCITE-5409:
--

In https://calcite.apache.org/docs/howto.html#making-a-release-candidate it 
says: 

{noformat}
Make sure that every “resolved” JIRA case (including duplicates) has a fix 
version assigned (most likely the version we are just about to release).
{noformat}

so I am just trying to make the life of the RM easier. 

We could change these requirements but I guess it is a topic for a separate 
discussion.

> Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE
> ---
>
> Key: CALCITE-5409
> URL: https://issues.apache.org/jira/browse/CALCITE-5409
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.32.0
>Reporter: Ulrich Kramer
>Priority: Major
> Fix For: 1.33.0
>
>
> Adding the following unit test to {{JdbcAdapterTest}} causes an 
> {{NullPointerException}}
> {code:java}
>   @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) planner -> {
>   planner.removeRule(EnumerableRules.ENUMERABLE_CORRELATE_RULE);
>   
> planner.addRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE);
> })
> .runs();
>   }
> {code}
> {code}
> 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
> {code}
> See also https://issues.apache.org/jira/browse/CALCITE-5354



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-5409) Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE

2022-11-30 Thread Ruben Q L (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-5409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17641336#comment-17641336
 ] 

Ruben Q L commented on CALCITE-5409:


[~zabetak], thanks for confirming that this issue is a duplicate of the one I 
mentioned on my previous comment (and closing it as such).
Just one small question, why the "fix version = 1.33" ? I'd say that the 
current ticket (or its duplicated) is not yet fixed.

> Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE
> ---
>
> Key: CALCITE-5409
> URL: https://issues.apache.org/jira/browse/CALCITE-5409
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.32.0
>Reporter: Ulrich Kramer
>Priority: Major
> Fix For: 1.33.0
>
>
> Adding the following unit test to {{JdbcAdapterTest}} causes an 
> {{NullPointerException}}
> {code:java}
>   @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) planner -> {
>   planner.removeRule(EnumerableRules.ENUMERABLE_CORRELATE_RULE);
>   
> planner.addRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE);
> })
> .runs();
>   }
> {code}
> {code}
> 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
> {code}
> See also https://issues.apache.org/jira/browse/CALCITE-5354



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (CALCITE-5409) Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE

2022-11-30 Thread Ruben Q L (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-5409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17641329#comment-17641329
 ] 

Ruben Q L commented on CALCITE-5409:


Maybe related to (or duplicate of?) CALCITE-4188

> Jdbc doesn't support EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE
> ---
>
> Key: CALCITE-5409
> URL: https://issues.apache.org/jira/browse/CALCITE-5409
> Project: Calcite
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.32.0
>Reporter: Ulrich Kramer
>Priority: Major
>
> Adding the following unit test to {{JdbcAdapterTest}} causes an 
> {{NullPointerException}}
> {code:java}
>   @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) planner -> {
>   planner.removeRule(EnumerableRules.ENUMERABLE_CORRELATE_RULE);
>   
> planner.addRule(EnumerableRules.ENUMERABLE_BATCH_NESTED_LOOP_JOIN_RULE);
> })
> .runs();
>   }
> {code}
> {code}
> 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
> {code}
> See also https://issues.apache.org/jira/browse/CALCITE-5354



--
This message was sent by Atlassian Jira
(v8.20.10#820010)