Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: introduce rich functions #136

Open
je-ik opened this issue May 25, 2017 · 0 comments
Open

Improvement: introduce rich functions #136

je-ik opened this issue May 25, 2017 · 0 comments

Comments

@je-ik
Copy link
Contributor

je-ik commented May 25, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants