Skip to contents

This invokes a user-defined function in TileDB Cloud.

Usage

execute_multi_array_udf(
  array_list,
  udf = NULL,
  registered_udf_name = NULL,
  args = NULL,
  result_format = "native",
  args_format = "native",
  namespace = NULL,
  language = "r",
  resource_class = NULL
)

Arguments

array_list

List of UDFArrayDetails objects. Example list element: tiledbcloud::UDFArrayDetails$new(uri="tiledb://demo/quickstart_dense", ranges=QueryRanges$new(layout=Layout$new('row-major'), ranges=list(cbind(1,4),cbind(1,4))), buffers=list("a"))

udf

An R function which takes dataframes as arguments, one dataframe argument for each element in array_list. Arguments are specified separately via args. One of udf and registered_udf_name must be non-null.

registered_udf_name

Name of a registered UDF, of the form namespace/udfname. Arguments are specified separately via args. One of udf and registered_udf_name must be non-null.

args

Arguments to the function. If the function takes no arguments, this can be omitted. If you want to call by position, use a list like args=list(123, 456). If you want to call by name, use a named list like args=list(x=123,y=456).

result_format

One of native, json, or arrow. These are used as wire format for returning results from the server to this library, primarily for memory-usage control. UDF return values handed back to your code from this library are converted back to natural R objects.

args_format

One of native, json, or arrow. These are used as wire format for sending arguments to the server. Normally you do not need to specify this. If you're invoking an R UDF, native is used; if you're invoking a registered Python UDF, json is used but you can select arrow if you wish.

namespace

Namespace within TileDB cloud to charge. If this is null, the logged-in user's username will be used for the namespace.

language

If omitted, defaults to "r". Can be set to "python" when executing registered Python UDFs.

resource_class

The resource class to use for the UDF execution. Resource classes define resource limits for memory and CPUs. If this is `NULL`, then the UDF will execute in the standard resource class of the TileDB Cloud provider. This can be set to "large".

Value

Return value from the UDF.

Details

Nominally you will first call login; if not, the results of the last login at ~/.tiledb/cloud.json will be used.

All arguments are required.