silundong opened a new pull request, #4824: URL: https://github.com/apache/calcite/pull/4824
The root cause is that `FilterJoinRule` was applied before the subquery was removed, and when [building the top Filter](https://github.com/apache/calcite/blob/7654dd82162508231cb3ed44e60fed356e931403/core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java#L251), the variablesSet was omitted. `SubQueryRemoveRule.FILTER_SUB_QUERY_TO_MARK_CORRELATE` performs a strict check on variablesSet when removing a subquery: if it is empty, a `Join` will be generated instead of a `Correlate`. As a result, the plan does not contain a `Correlate`, but correlated variables remain. -- 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]
