gustavodemorais commented on code in PR #28128:
URL: https://github.com/apache/flink/pull/28128#discussion_r3208868588
##########
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/PartitionedTable.java:
##########
@@ -169,4 +169,70 @@ public interface PartitionedTable {
* @see ProcessTableFunction
*/
Table process(Class<? extends UserDefinedFunction> function, Object...
arguments);
+
+ /**
+ * Converts this partitioned dynamic table into an append-only table with
an explicit operation
+ * code column using the built-in {@code TO_CHANGELOG} process table
function with set
+ * semantics.
+ *
+ * <p>Each input row - regardless of its original change operation - is
emitted as an
+ * INSERT-only row with a string {@code "op"} column indicating the
original operation (INSERT,
+ * UPDATE_AFTER, DELETE, etc.). With set semantics, rows for the same
partition key are
+ * co-located in the same parallel operator instance.
+ *
+ * <p>For row semantics (each row processed independently), use {@link
Table#toChangelog} on the
+ * unpartitioned table.
+ *
+ * <p>Example:
+ *
+ * <pre>{@code
+ * Table result = table
+ * .partitionBy($("id"))
+ * .toChangelog(
+ * descriptor("op_code").asArgument("op"),
+ * map("INSERT", "I", "UPDATE_AFTER", "U").asArgument("op_mapping")
+ * );
+ * }</pre>
+ *
+ * @param arguments optional named arguments for {@code op} and {@code
op_mapping}
+ * @return an append-only {@link Table} with an {@code op} column and the
partition keys
+ * prepended to the input columns
Review Comment:
nit: The `@return` says "partition keys prepended to the input columns" but
the actual output drops the partition columns from the trailing portion
(FLINK-39614). Worth matching the docs' explicit shape so readers don't expect
duplicates:
```suggestion
* @return an append-only {@link Table} ordered as `[partition_keys, op,
non_partition_input_columns]`
```
Same fix for `fromChangelog`.
--
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]