IGNITE-23799 : Calcite. Hash join.#11770
Conversation
# Conflicts: # modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ExecutionTest.java # modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/JoinCommutePlannerTest.java
This reverts commit 3337e98.
...ain/java/org/apache/ignite/internal/processors/query/calcite/rule/HashJoinConverterRule.java
Show resolved
Hide resolved
|
|
||
| /** Tests 'Select e.id, e.name, d.name as dep_name from DEP d <JOIN TYPE> join EMP e on e.DEPNO = d.DEPNO'. */ | ||
| @Test | ||
| public void testHashJoin() { |
There was a problem hiding this comment.
ExecutionTest already contains a lot of unsorted tests, maybe it's time to move join tests to another class. But we also have MergeJoinExecutionTest/NestedLoopJoinExecutionTest they look almost identical and looks like they cover more cases than testHashJoin test. Maybe it's better to extract common part and add new HashJoinExecutionTest class.
There was a problem hiding this comment.
I think you are right. But this might be other tests refactoring ticket.
...internal/processors/query/calcite/integration/CalciteBasicSecondaryIndexIntegrationTest.java
Outdated
Show resolved
Hide resolved
...st/java/org/apache/ignite/internal/processors/query/calcite/planner/HashJoinPlannerTest.java
Outdated
Show resolved
Hide resolved
...st/java/org/apache/ignite/internal/processors/query/calcite/planner/HashJoinPlannerTest.java
Outdated
Show resolved
Hide resolved
| private static List<List<Object>> testJoinIsAppliedParameters() { | ||
| return F.asList( | ||
| F.asList("select t1.c1 from t1 %s join t1 t2 using(c1)", true), | ||
| F.asList("select t1.c1 from t1 %s join t1 t2 on t1.c1 = t2.c1", true), |
There was a problem hiding this comment.
Please add two columns test.
Also, in cases like t1.c1 = t2.c2 and t1.id = 1 second condition can be pushed down to table scan (at least for some types of join), perhaps these cases should be tested too.
There was a problem hiding this comment.
There are two-column tests below. Yes, some scans are pushed down and join uses only one equi join pair.
...a/org/apache/ignite/internal/processors/query/calcite/planner/JoinColocationPlannerTest.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/HashJoinNode.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/HashJoinNode.java
Outdated
Show resolved
Hide resolved
# Conflicts: # modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ExecutionTest.java # modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/JoinCommutePlannerTest.java
# Conflicts: # modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/PlannerTest.java
# Conflicts: # modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/RuntimeHashIndex.java # modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/NestedLoopJoinNode.java # modules/calcite/src/test/java/org/apache/ignite/testsuites/ExecutionTestSuite.java
modules/calcite/src/test/java/org/apache/ignite/testsuites/ExecutionTestSuite.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/NestedLoopJoinNode.java
Show resolved
Hide resolved
...che/ignite/internal/processors/query/calcite/exec/rel/AbstractRightMaterializedJoinNode.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/NestedLoopJoinNode.java
Outdated
Show resolved
Hide resolved
… IGNITE-23799_calcite_hash_join
...in/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/NestedLoopJoinNode.java
Outdated
Show resolved
Hide resolved
...che/ignite/internal/processors/query/calcite/exec/rel/AbstractRightMaterializedJoinNode.java
Show resolved
Hide resolved
...src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/HashJoinNode.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/HashJoinNode.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/RuntimeHashIndex.java
Outdated
Show resolved
Hide resolved
...st/java/org/apache/ignite/internal/processors/query/calcite/planner/HashJoinPlannerTest.java
Outdated
Show resolved
Hide resolved
...a/org/apache/ignite/internal/processors/query/calcite/planner/JoinColocationPlannerTest.java
Show resolved
Hide resolved
...src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/HashJoinNode.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/HashJoinNode.java
Outdated
Show resolved
Hide resolved
| RowT right = rightIt.next(); | ||
|
|
||
| if (nonEqCond != null && !nonEqCond.test(left, right)) | ||
| continue; |
There was a problem hiding this comment.
For left join we should emit row with empty right part, but only once per one left row
...java/org/apache/ignite/internal/processors/query/calcite/exec/rel/HashJoinExecutionTest.java
Outdated
Show resolved
Hide resolved
| /** */ | ||
| @Test | ||
| public void testLeftJoinWithPostFiltration() { | ||
| Object[][] expected = new Object[][]{ |
There was a problem hiding this comment.
Every row from the left side should be in the set
There was a problem hiding this comment.
There is a condition ((CharSequence)l[1]).length() > 4;. However, Left is reverted for now.
This reverts commit 006fa69.
|




No description provided.