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_r333886126
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/rules/logical/ExpressionReductionRulesTest.scala
 ##########
 @@ -46,4 +47,21 @@ class ExpressionReductionRulesTest extends TableTestBase {
     util.verifyPlan("SELECT myUdf(1) FROM MyTable")
   }
 
+  @Test
+  def testExpressionReductionWithPythonUDF(): Unit = {
+    util.addFunction("PyUdf", MockedPythonUDFWithoutArguments)
+    util.addFunction("MyUdf", Func1)
+    util.verifyPlan("SELECT PyUdf(), MyUdf(1) FROM MyTable")
+  }
+}
+
+object MockedPythonUDFWithoutArguments extends ScalarFunction {
 
 Review comment:
   IMO it's not necessary to check non-deterministic python UDFs in this rule 
test. My reason is:
   1. If the UDF is non-deterministic, it won't match this rule whether it is a 
Python UDF or not. This test case won't cover more code.
   2. We already have a ITCase about non-deterministic python UDF in 
`test_udf.py` to make sure the non-deterministic python UDFs work properly.

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


With regards,
Apache Git Services

Reply via email to