dianfu commented on a change in pull request #11749: [FLINK-16669][python][table] Support Python UDF in SQL function DDL. URL: https://github.com/apache/flink/pull/11749#discussion_r409258002
########## File path: flink-python/pyflink/table/tests/test_table_environment_api.py ########## @@ -329,6 +329,13 @@ def test_table_environment_with_blink_planner(self): self.assert_equals(results, ['2,hi,hello\n', '3,hello,hello\n']) + def test_sql_ddl(self): + self.t_env.sql_update("create temporary function func1 as " + "'pyflink.table.tests.test_udf.add' language python") + table = self.t_env.from_elements([(1, 2)]).alias("a, b").select("func1(a, b)") + plan = self.t_env.explain(table) + self.assertTrue(plan.find("DataStreamPythonCalc(select=[add(f0, f1) AS _c0])") >= 0) + Review comment: Change to `plan.find("PythonCalc(xxx)")` and then the test case `test_sql_ddl` could be shared between batch and stream? ---------------------------------------------------------------- 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