twalthr commented on code in PR #27929:
URL: https://github.com/apache/flink/pull/27929#discussion_r3086004075


##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/PartitionedTable.java:
##########
@@ -35,6 +36,36 @@
 @PublicEvolving
 public interface PartitionedTable {
 
+    /**
+     * Sorts the partitioned table within each partition.
+     *
+     * <p>This is useful for process table functions that need ordered input 
within each set scoped
+     * by the key.
+     *
+     * <p>Note: The first sorting column must be a time attribute column in 
ascending order for
+     * which a watermark has been declared. The watermarked column must be 
forwarded without any
+     * modification to ensure event-time sorting. Secondary ordering columns 
can differ and are used
+     * for deterministic ordering within the same timestamp.
+     *
+     * <p>Example:
+     *
+     * <pre>{@code
+     * // Primary ordering by watermarked timestamp, secondary by score
+     * env.fromCall(
+     *   "MyPTF",
+     *   table
+     *     .partitionBy($("key"))
+     *     .orderBy($("ts").asc(), $("score").desc())
+     *     .asArgument("input_table")
+     * )
+     * }</pre>
+     *
+     * @param fields expressions for ordering (e.g., {@code $("ts").asc(), 
$("score").desc()})
+     * @return a partitioned and ordered table

Review Comment:
   a PTF is not an expression, so it cannot be used at regular scalar function 
locations.



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