HuangXingBo commented on a change in pull request #13421:
URL: https://github.com/apache/flink/pull/13421#discussion_r491994679
##########
File path: flink-python/pyflink/fn_execution/beam/beam_operations_fast.pyx
##########
@@ -173,6 +173,28 @@ cdef class
DataStreamStatelessFunctionOperation(BeamStatelessFunctionOperation):
func = operation_utils.extract_data_stream_stateless_funcs(udfs)
return func, []
+
+cdef class PandasAggregateFunctionOperation(BeamStatelessFunctionOperation):
+ def __init__(self, name, spec, counter_factory, sampler, consumers):
+ super(PandasAggregateFunctionOperation, self).__init__(name, spec,
counter_factory,
+ sampler,
consumers)
+
+ def generate_func(self, udfs):
+ pandas_functions, variable_dict, user_defined_funcs = reduce(
+ lambda x, y: (
+ ','.join([x[0], y[0]]),
+ dict(chain(x[1].items(), y[1].items())),
+ x[2] + y[2]),
+ [operation_utils.extract_user_defined_function(udf) for udf in
udfs])
+ variable_dict['wrap_pandas_result'] =
operation_utils.wrap_pandas_result
+ mapper = eval('lambda value: wrap_pandas_result([%s])' %
pandas_functions, variable_dict)
+ if self._is_python_coder:
Review comment:
We currently only provide the implementation of arrow coder with python
version, so it is always true
----------------------------------------------------------------
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]