-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
Introduce alternative "rich" UDFs to operators. These functions will have access to (at least) the following:
public interface RichUnaryFunction<IN, OUT> extends UnaryFunction<IN, OUT> {
/** Called before the first element. */
void init(Context context);
/** The UDF itself. */
@Override
OUT apply(IN elem);
/** Called after last element (might not necessarily be absolutely last element,
but at least another `init` will be called before next `apply` */
void close();
}The Context passed into init should be the same as the one passed to Functor versions. We must make sure that the current code doesn't break (mostly in terms of using lambdas where appropriate), that is, we either create separate calls with these rich function variants, or we will add these calls to "standard" UDFs, but with default empty implementation.
Reactions are currently unavailable