evadb.EvaDBCursor.create_function#

EvaDBCursor.create_function(udf_name: str, if_not_exists: bool = True, impl_path: Optional[str] = None, type: Optional[str] = None, **kwargs) EvaDBQuery[source]#

Create a udf in the database.

Parameters:
  • udf_name (str) – Name of the udf to be created.

  • if_not_exists (bool) – If True, do not raise an error if the UDF already exist. If False, raise an error.

  • impl_path (str) – Path string to udf’s implementation.

  • type (str) – Type of the udf (e.g. HuggingFace).

  • **kwargs – Additional keyword arguments for configuring the create udf operation.

Returns:

The EvaDBQuery object representing the UDF created.

Return type:

EvaDBQuery

Examples

>>> cursor.create_function("MnistImageClassifier", if_exists = True, 'mnist_image_classifier.py')
    0
0   UDF Successfully created: MnistImageClassifier