snuyanzin commented on code in PR #27328:
URL: https://github.com/apache/flink/pull/27328#discussion_r2600425668


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/utils/FlinkRelUtil.java:
##########
@@ -122,6 +135,43 @@ public static boolean isMergeable(Calc topCalc, Calc 
bottomCalc) {
         return mergeable(topInputRefCounter, topInputRefs, bottomProjects);
     }
 
+    private static boolean functionResultShouldBeReused(
+            List<? extends RexNode> topProjectList, List<? extends RexNode> 
bottomProjectList) {
+        Set<Integer> indexSet = new HashSet<>();
+        for (int i = 0; i < bottomProjectList.size(); i++) {
+            RexNode project = bottomProjectList.get(i);
+            if (project instanceof RexCall
+                    && SqlKind.FUNCTION.contains(((RexCall) 
project).op.getKind())
+                    && ((RexCall) project).op.isDeterministic()) {

Review Comment:
   this is still a kind of PoC
   
   regarding deterministic: further in stack there is a dedicated check for 
deterministic/non-deterministic, so do not care much about this here



-- 
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]

Reply via email to