Hello, Flag expand=false is required to support some types of subqueries. But we can also perform decorrelation explicitly after subquery rewriting. I've filled the ticket [1]. Thank you!
[1]: https://issues.apache.org/jira/browse/IGNITE-16493 сб, 5 февр. 2022 г. в 14:50, Chang Chen <baibaic...@gmail.com>: > Hi All > > > IIUC, the current implementation may be problematic. > > Ignite disabled subquery rewriting in this PR( > https://github.com/apache/ignite/pull/9251), and I think the correct > process would be sqlnode => relnode => convert RexSubQuery to Correlate => > decorrelateQuery, however, the last two steps are inverse in the current > implementation. See PlannerHelper#optimize. > > > > 1. IgnitePlanner#rel will be called first, and > SqlToRelConverter#decorrelate will be called in this function. > 2. Then, HEP_DECORRELATE will be called. The rules of this phase are all > subquery removing(i.e. convert RexSubQuery to Correlate). > > > Although IgniteCorrelatedNestedLoopJoin could be used to implement > LogicalCorrelate, this is inefficient. >