[ 
https://issues.apache.org/jira/browse/CALCITE-6870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17932173#comment-17932173
 ] 

xiong duan commented on CALCITE-6870:
-------------------------------------

Fixed in 
[4b6fb66|https://github.com/apache/calcite/commit/4b6fb668ef46549371669507edfe36f937f3ef0f]
 . Thanks for the review [~mbudiu] [~asolimando] and [~suibianwanwan33] .

> The FilterToCalcRule/ProjectToCalcRule should not convert a Filter/Project to 
> Calc when it contains Subquery
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-6870
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6870
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: xiong duan
>            Priority: Major
>              Labels: pull-request-available
>
>  The unit test in RelOptRulesTest:
> {code:java}
> @Test void testFilterToCalc() {
>   final String sql = "select ename from emp where sal > all (select comm from 
> emp)";
>   sql(sql)
>       .withRule(CoreRules.FILTER_TO_CALC)
>       .checkUnchanged();
> } {code}
> Now the Calcite's SubQueryRemoveRule includes FILTER_SUB_QUERY_TO_CORRELATE、
> PROJECT_SUB_QUERY_TO_CORRELATE、JOIN_SUB_QUERY_TO_CORRELATE. 
> It doesn't have a CALC_SUB_QUERY_TO_CORRELATE. When the plan has CALC with 
> Subquery, then it can't be converted.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to