Skip to content

Improvement: introduce rich functions #136

@je-ik

Description

@je-ik

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions