dianfu 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_r333361887
##########
File path:
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/rules/logical/ExpressionReductionRulesTest.scala
##########
@@ -46,4 +46,21 @@ class ExpressionReductionRulesTest extends TableTestBase {
util.verifyPlan("SELECT myUdf(1) FROM MyTable")
}
+ @Test
+ def testExpressionReductionWithPythonUDF(): Unit = {
+ util.addFunction("PyUdf", MockedPythonScalarFunction)
+ util.addFunction("MyUdf", Func1)
+ util.verifyPlan("SELECT PyUdf(), MyUdf(1) FROM MyTable")
+ }
+}
+
+object MockedPythonScalarFunction extends ScalarFunction {
Review comment:
rename to PythonUDFWithoutArgument?
----------------------------------------------------------------
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