silundong commented on code in PR #4392:
URL: https://github.com/apache/calcite/pull/4392#discussion_r2155823161


##########
core/src/main/java/org/apache/calcite/rel/rules/JoinToHyperGraphRule.java:
##########
@@ -55,119 +53,146 @@ protected JoinToHyperGraphRule(Config config) {
     final Join origJoin = call.rel(0);
     final RelNode left = call.rel(1);
     final RelNode right = call.rel(2);
-    if (origJoin.getJoinType() != JoinRelType.INNER) {
+    if (unSupportedJoinType(origJoin.getJoinType())) {

Review Comment:
   You're right, I'll update it. :)



##########
core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml:
##########
@@ -1643,6 +1670,33 @@ LogicalProject(EMPNO=[$9])
     LogicalJoin(condition=[=($3, $0)], joinType=[inner])
       LogicalTableScan(table=[[CATALOG, SALES, EMP_ADDRESS]])
       LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+]]>
+    </Resource>
+  </TestCase>
+  <TestCase name="testComplexPredicateForDphyp">
+    <Resource name="sql">
+      <![CDATA[select emp.empno from emp, emp_b, dept, dept_nested where 
emp.deptno + emp_b.empno = dept.deptno + dept_nested.deptno and (emp.empno = 
emp_b.empno or emp.ename = emp_b.ename) and sqrt(dept.deptno + 
dept_nested.deptno) > 2]]>
+    </Resource>
+    <Resource name="planBefore">
+      <![CDATA[
+LogicalProject(EMPNO=[$0])
+  HyperGraph(edges=[{0, 1, 2}——[INNER, =(+(node(0)_field(7), 
node(1)_field(0)), +(node(2)_field(0), node(3)_field(0)))]——{3},{2}——[INNER, 
>(POWER(+(node(2)_field(0), node(3)_field(0)), 0.5:DECIMAL(2, 1)), 
CAST(2):DOUBLE NOT NULL)]——{3},{0, 1}——[INNER, true]——{2},{0}——[INNER, 
OR(=(node(0)_field(0), node(1)_field(0)), =(node(0)_field(1), 
node(1)_field(1)))]——{1}])

Review Comment:
   The print of hyperedge is indeed a bit long. But I think it is necessary to 
print the endpoints, join type and condition of hyperedge, I haven't thought of 
a better form yet.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to