public class PythonReduceFunction extends Object implements ReduceFunction<org.python.core.PyObject>
PythonReduceFunction
is a thin wrapper layer over a Python UDF ReduceFunction
.
It receives a ReduceFunction
as an input and keeps it internally in a serialized form.
It is then delivered, as part of the job graph, up to the TaskManager, then it is opened and becomes
a sort of mediator to the Python UDF ReduceFunction
.
This function is used internally by the Python thin wrapper layer over the streaming data functionality
Constructor and Description |
---|
PythonReduceFunction(ReduceFunction<org.python.core.PyObject> fun) |
Modifier and Type | Method and Description |
---|---|
org.python.core.PyObject |
reduce(org.python.core.PyObject value1,
org.python.core.PyObject value2)
The core method of ReduceFunction, combining two values into one value of the same type.
|
public PythonReduceFunction(ReduceFunction<org.python.core.PyObject> fun) throws IOException
IOException
public org.python.core.PyObject reduce(org.python.core.PyObject value1, org.python.core.PyObject value2) throws Exception
ReduceFunction
reduce
in interface ReduceFunction<org.python.core.PyObject>
value1
- The first value to combine.value2
- The second value to combine.Exception
- This method may throw exceptions. Throwing an exception will cause the operation
to fail and may trigger recovery.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.