rbc
rbc copied to clipboard
Defining UDF/UDTFs from file or text using SQL DEFINE.
Some ideas from Slack discussion https://quansight.slack.com/archives/C01CAU0U1FH/p1605529329121500:
DEFINE UDTF dbscan FROM '/path/to/dbscan.cpp' WITH (mode='cpu', source='file');
DEFINE UDTF dbscan FROM 'int32 dbscan__cpu_0(Column<double> x, ...) { ... }' WITH (lang='c++', source='text');
where lang
can be c++
, python
, etc.
Note that a single .cpp/.py file may contain several UDF/UDTF definitions.