mihaibudiu commented on code in PR #4814:
URL: https://github.com/apache/calcite/pull/4814#discussion_r2885469358


##########
core/src/main/java/org/apache/calcite/rel/rules/SubQueryRemoveRule.java:
##########
@@ -622,6 +623,43 @@ private static RexNode rewriteIn(RexSubQuery e, 
Set<CorrelationId> variablesSet,
     // from emp as e
     // inner join (select distinct deptno from emp) as dt
     //   on e.deptno = dt.deptno
+    //
+    // For multi-column IN where at least one key or RHS column is nullable, a
+    // single wildcard LEFT JOIN handles both exact and partial-null matches,
+    // while all-null RHS rows are excluded from dt and detected via ct.ck < 
ct.c:
+    //
+    // select e.empno, (e.empno, e.comm) in (select empno, comm from emp)
+    // from emp as e
+    //
+    // becomes
+    //
+    // select e.empno,

Review Comment:
   this is very useful



-- 
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