WeiZhong94 commented on a change in pull request #9865: [FLINK-14212][python] 
Support no-argument Python UDFs.
URL: https://github.com/apache/flink/pull/9865#discussion_r333381690
 
 

 ##########
 File path: flink-python/pyflink/table/tests/test_udf.py
 ##########
 @@ -204,6 +204,28 @@ def eval(self, col):
             self.t_env.register_function(
                 "non-callable-udf", udf(Plus(), DataTypes.BIGINT(), 
DataTypes.BIGINT()))
 
+    def test_udf_without_arguments(self):
+        @udf(input_types=[], result_type=DataTypes.BIGINT(), 
deterministic=True)
 
 Review comment:
   1. In current design it will throw an exception if we don't declare 
input_types. And IMO the lack of input_types should not be considered as a 
no-argument UDF. It means we should infer the input types when the UDF is 
called. 
   2. I have replaced current UDFs with lambda in the latest commit.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to