raoraoxiong commented on code in PR #28998:
URL: https://github.com/apache/flink/pull/28998#discussion_r3920899226


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/python/PythonFunctionInfo.java:
##########
@@ -36,11 +36,65 @@ public class PythonFunctionInfo implements Serializable {
     private final PythonFunction pythonFunction;
 
     /**
-     * The input arguments, it could be an input offset of the input row or 
the execution result of
-     * another python function described as PythonFunctionInfo.
+     * The input arguments. It could be one of the following:
+     *
+     * <ul>
+     *   <li>{@link Integer} – an input offset of the input row
+     *   <li>{@link PythonFunctionInfo} – the execution result of another 
python function (nested
+     *       call)
+     *   <li>{@code byte[]} – a constant value
+     *   <li>{@link ResultRef} – a reference to the result of a previously 
computed function in the
+     *       flattened UDF list (used for cross-subtree CSE)
+     * </ul>
      */
     private Object[] inputs;
 
+    /**
+     * This function's position in the operator output, or {@code -1} when its 
result is only
+     * referenced by another function and must not be emitted.
+     */
+    private int outputPosition = -1;

Review Comment:
   **Removed `outputPosition` from `PythonFunctionInfo`** — I agree, and it also
   exposed a detour in the original design: the planner already holds the output
   indices, but encoded them into each function only for `ProtoUtils` to decode 
them
   back by filtering and sorting. The indices are now passed as a value from the
   ExecNode to the operator and on to `ProtoUtils`. The existing four-argument
   overload is kept, so the table function, arrow aggregate and embedded call 
sites
   are untouched.



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