mihaibudiu commented on code in PR #4619:
URL: https://github.com/apache/calcite/pull/4619#discussion_r2587118111
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableJoinRule.java:
##########
@@ -48,8 +52,12 @@ protected EnumerableJoinRule(Config config) {
super(config);
}
- @Override public RelNode convert(RelNode rel) {
+ @Override public @Nullable RelNode convert(RelNode rel) {
Join join = (Join) rel;
+ if (!Bug.TODO_FIXED && join.getJoinType() == JoinRelType.MARK) {
Review Comment:
Can we merge this PR without this implementation to validate actual
computations?
From the description it does not look like having a native mark join in this
convention is actually too much work.
##########
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:
do you mean "if the marker is used only in"?
So the output of MARK_JOIN has an extra nullable boolean field in addition
to the fields from the left and the right inputs?
--
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]