silundong commented on code in PR #4619:
URL: https://github.com/apache/calcite/pull/4619#discussion_r2587452372
##########
core/src/main/java/org/apache/calcite/rel/core/JoinRelType.java:
##########
@@ -91,7 +91,32 @@ public enum JoinRelType {
/**
* The left version of an ASOF join, where each row from the left table is
part of the output.
*/
- LEFT_ASOF;
+ LEFT_ASOF,
+
+ /**
+ * An MARK JOIN will keep all rows from the left side and creates a new
attribute to mark a
+ * tuple as having join partners from right side or not. Refer to
+ * <a href="https://dl.gi.de/items/c5f7c49f-1572-490e-976a-cc4292519bdd">
+ * The Complete Story of Joins (in HyPer)</a>.
+ *
+ * <p>Example:
+ * <blockquote><pre>
+ * SELECT EMPNO FROM EMP
+ * WHERE EXISTS (SELECT 1 FROM DEPT
+ * WHERE DEPT.DEPTNO = EMP.DEPTNO)
+ * OR EMPNO > 1
+ *
+ * LogicalProject(EMPNO=[$0])
+ * LogicalFilter(condition=[OR($9, >($0, 1))])
+ * LogicalJoin(condition=[IS NOT DISTINCT FROM($7, $9)], joinType=[mark])
+ * LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+ * LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
+ * </pre></blockquote>
+ *
+ * <p> If the marker is used on only conjunctive predicates the optimizer
will try to translate
Review Comment:
Yes, it should be "used only in".
The output of MARK JOIN is as described in the first sentence of the
comment: An MARK JOIN will keep all rows from the left side and creates a new
attribute to mark a tuple as having join partners from right side or not. It
will not output the fields from the right side.
I looked at the SEMI/ANTI above — I think they implicitly represent (LEFT)
SEMI/ANTI, and therefore define MARK directly. Should I stay consistent with
that, or explicitly name it LEFT MARK? In my option, RIGHT MARK/SEMI/ANTI are
variants of LEFT MARK/SEMI/ANTI to support join commutativity. Should I define
them in this ticket?
--
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]