Xpray commented on a change in pull request #6455: [FLINK-9997] [table] Improve Expression Reduce URL: https://github.com/apache/flink/pull/6455#discussion_r222677089
########## File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/BatchTableEnvironment.scala ########## @@ -480,11 +480,20 @@ abstract class BatchTableEnvironment( normalizedPlan } - // 4. optimize the physical Flink plan + // 4. optimize the logical Flink plan + val flinkLogicalOptRuleSet = getFlinkLogicalOptRuleSet Review comment: @twalthr You're right, ReduceExpressionRule.CALC should add to logical opt phase, but I tried it and it result to java.lang.OutOfMemoryError when I test `testReduceDeterministicUDF`. I believe the calc rules (`FilterCalcMergeRule, ProjectCalcMergeRule, FilterToCalcRule, ProjectToCalcRule, CalcMergeRule`) interact with each other. If adding a new phase after, there's only calc node, the search space is quite small than in logical opt phase. I think adding phase is necessary as the number of rule increasing. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services