gustavodemorais commented on code in PR #27901:
URL: https://github.com/apache/flink/pull/27901#discussion_r3098974064
##########
flink-python/pyflink/table/table.py:
##########
@@ -1188,6 +1188,42 @@ def insert_into(
)
+ def from_changelog(self, *arguments: Expression) -> 'Table':
+ """
+ Converts this append-only table with an explicit operation code column
into a
+ (potentially updating) dynamic table using the built-in
``FROM_CHANGELOG``
+ process table function.
+
+ Each input row is expected to have a string operation code column
(default: ``op``)
+ that indicates the change operation. The operation column is
interpreted by the
+ engine and removed from the output.
+
+ Example:
+ ::
+
+ >>> from pyflink.table.expressions import descriptor, map_
+ >>> # Default: reads 'op' column with standard change operation
names
+ >>> table.from_changelog()
+ >>> # With custom op column name
+ >>> table.from_changelog(
+ ... descriptor("operation").as_argument("op")
+ ... )
+ >>> # With custom op_mapping
+ >>> table.from_changelog(
+ ... descriptor("op").as_argument("op"),
+ ... map_("c, r", "INSERT",
+ ... "ub", "UPDATE_BEFORE",
+ ... "ua", "UPDATE_AFTER",
+ ... "d", "DELETE").as_argument("op_mapping")
+ ... )
+
+ :param arguments: Optional named arguments for ``op`` and
``op_mapping``.
+ :return: A (potentially updating) :class:`~pyflink.table.Table` with
the op column
+ removed and proper change operation semantics.
+ """
+ return
Table(self._j_table.fromChangelog(to_expression_jarray(arguments)), self._t_env)
+
+
Review Comment:
nit: there are two blank lines and that will make the python CI fail
```
Apr 16 14:36:24 ================flake8 checks=================
Apr 16 14:36:25 ./pyflink/table/table.py:1191:5: E303 too many blank lines
(2)
```
--
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]