Skip to content

Implementation of UDF generator

Kostas FILIPPOPOLITIS requested to merge jason/dev/udfgen into master

Created by: jassak

Introduces:

  • A function generate_udf to be called with parameters:
    func_name: str,
    udf_name: str,
    input_tables: list[dict],
    loopback_tables: list[dict],
    literalparams: dict,
    This method produces a string with the corresponding SQL UDF definition.
  • A decorator udf to be used with all functions which will be used as MonetDB Python UDFs. These functions have to be type annotated with a number of allowed types (see below).
  • A series of Types to use with UDFs. Namelly:
    • TableT, representing a relational table in the DB, passed as an argument to a UDF.
    • TensorT, representing a n-dimensional tensor, stored as a table in the DB, also passed as an argument.
    • LoopbackTableT, a table stored in the DB but loaded in the UDF as a loopback call.
    • LiteralParameterT, a scalar parameter not stored in the DB, hard-coded as a literal in the UDF body.
    • ScalarT used only for scalar return types.

Merge request reports