HuangXingBo commented on a change in pull request #14317:
URL: https://github.com/apache/flink/pull/14317#discussion_r539046967



##########
File path: flink-python/pyflink/table/table.py
##########
@@ -759,6 +759,27 @@ def drop_columns(self, *fields: Union[str, Expression]) -> 
'Table':
             assert isinstance(fields[0], str)
             return Table(self._j_table.dropColumns(fields[0]), self._t_env)
 
+    def map(self, func: Union[str, Expression]) -> 'Table':
+        """
+        Performs a map operation with an user-defined scalar function.
+
+        Example:
+        ::
+
+            >>> add = udf(lambda x: Row(x + 1, x *x), 
result_type=DataTypes.Row(
+            ... [DataTypes.FIELD("a", DataTypes.INT()), DataTypes.FIELD("b", 
DataTypes.INT())]))
+            >>> table_env.create_temporary_function("add", add)
+            >>> tab.map(add(tab.a)).alias("a, b")
+            >>> tab.map("add(a)").alias("a, b")

Review comment:
       Yes. Make sense.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to