User-defined Functions

    Currently, it supports two kinds of Python user-defined functions: the general Python user-defined functions which process data one row at a time and which process data one batch at a time.

    There are scenarios when you want to load some resources in UDFs first, then running computation (i.e., eval) over and over again, without having to re-load the resources. For example, you may want to load a large deep learning model only once, then run batch prediction against the model multiple times.

    Suppose you have defined a Python user-defined function as following: