davidradl commented on code in PR #27328:
URL: https://github.com/apache/flink/pull/27328#discussion_r2598139776
##########
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:
I do not know this area very well, just to check my understanding
- why are we calling the rexNodes projects and not rexNodes?
- I assume that `isDeterministic` implies that for a given input you get the
same output. If there are non deterministic functions in the list of projects,
this could imply we cannot use the output for those. Is it safe to reuse the
results if there are non deterministic projects? What would it mean to re-use
the results when there is a mix of deterministic and non-deterministic
projects?
--
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]