dianfu commented on a change in pull request #9890: 
[FLINK-14272][python][table-planner-blink] Support Blink planner for Python UDF
URL: https://github.com/apache/flink/pull/9890#discussion_r336297346
 
 

 ##########
 File path: flink-python/pyflink/table/udf.py
 ##########
 @@ -167,13 +166,25 @@ def _create_judf(self):
         j_input_types = utils.to_jarray(gateway.jvm.TypeInformation,
                                         [_to_java_type(i) for i in 
self._input_types])
         j_result_type = _to_java_type(self._result_type)
-        return gateway.jvm.org.apache.flink.table.util.python.PythonTableUtils 
\
-            .createPythonScalarFunction(self._name,
-                                        bytearray(serialized_func),
-                                        j_input_types,
-                                        j_result_type,
-                                        self._deterministic,
-                                        _get_python_env())
+        if is_blink_planner:
 
 Review comment:
   What about change it as following?
   ```
   if is_blink_planner:
     PythonTableUtils = 
gateway.jvm.org.apache.flink.table.planner.utils.python.PythonTableUtils
   else:
     PythonTableUtils= gateway.jvm.PythonTableUtils
   
   j_scalar_function = gateway.jvm.PythonTableUtils \
                   .createPythonScalarFunction(self._name,
                                               bytearray(serialized_func),
                                               j_input_types,
                                               j_result_type,
                                               self._deterministic,
                                               _get_python_env())
   ```

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