hequn8128 commented on a change in pull request #11130:
[FLINK-15972][python][table-planner][table-planner-blink] Add Python building
blocks to make sure the basic functionality of Python TableFunction could work
URL: https://github.com/apache/flink/pull/11130#discussion_r383892660
##########
File path: flink-python/pyflink/fn_execution/operations.py
##########
@@ -148,54 +149,54 @@ def __init__(self, scalar_function, inputs):
def invoke_open(self):
"""
- Invokes the ScalarFunction.open() function.
+ Invokes the StatelessFunction.open() function.
"""
for input_getter in self.input_getters:
input_getter.open()
# set the FunctionContext to None for now
- self.scalar_function.open(None)
+ self.user_defined_function.open(None)
def invoke_close(self):
"""
- Invokes the ScalarFunction.close() function.
+ Invokes the StatelessFunction.close() function.
"""
for input_getter in self.input_getters:
input_getter.close()
- self.scalar_function.close()
+ self.user_defined_function.close()
def invoke_eval(self, value):
"""
- Invokes the ScalarFunction.eval() function.
+ Invokes the StatelessFunction.eval() function.
:param value: the input element for which eval() method should be
invoked
"""
args = [input_getter.get(value) for input_getter in self.input_getters]
- return self.scalar_function.eval(*args)
+ return self.user_defined_function.eval(*args)
-def create_scalar_function_invoker(scalar_function_proto):
+def create_stateless_function_invoker(user_defined_function_proto):
"""
- Creates :class:`ScalarFunctionInvoker` from the proto representation of a
- :class:`ScalarFunction`.
+ Creates :class:`StatelessFunctionInvoker` from the proto representation of
a
+ :class:`ScalarFunction` or :class:`TableFunction`.
- :param scalar_function_proto: the proto representation of the Python
:class:`ScalarFunction`
- :return: :class:`ScalarFunctionInvoker`.
+ :param user_defined_function_proto: the proto representation of the Python
+ :class:`ScalarFunction` or :class:`TableFunction`.
+ :return: :class:`TableFunctionInvoker`.
"""
- scalar_function = cloudpickle.loads(scalar_function_proto.payload)
- return ScalarFunctionInvoker(scalar_function, scalar_function_proto.inputs)
+ table_function = cloudpickle.loads(user_defined_function_proto.payload)
Review comment:
table_function => user_defined_function. Please check all these errors in
this class.
----------------------------------------------------------------
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