xiedeyantu commented on PR #4717: URL: https://github.com/apache/calcite/pull/4717#issuecomment-3706870312
> Perhaps you could try constructing a `Window` in correlated subquery (`TopDownGeneralDecorrelator` can handle window functions in the `Project`, but it doesn't support `Window`). For example, in `RelOptRulesTest`: > > ``` > final String sql = "SELECT empno FROM emp e WHERE sal > some(SELECT avg(sal) over (partition by deptno) from emp_b b where b.deptno = e.deptno)"; > > sql(sql) > .withRule( > CoreRules.FILTER_SUB_QUERY_TO_MARK_CORRELATE, > CoreRules.PROJECT_TO_LOGICAL_PROJECT_AND_WINDOW) > .withLateDecorrelate(true) > .withTopDownGeneralDecorrelate(true) > .check(); > ``` Thank you for providing the case; I have added it. -- 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]
