Help Center/
DataArts Fabric/
Developer Guide/
Function Reference/
UDFs/
UDF Development (Python)/
UDTF
Updated on 2025-12-19 GMT+08:00
UDTF
The development process for a UDTF is similar to that of a scalar UDF, with the following key considerations:
- The handler currently only supports returning iterators, so using yield is recommended.
- UDTFs do not support concurrent execution or vectorized computation.
- If the handler enters an infinite loop or produces endless output, Fabric SQL will automatically terminate the program based on the timeout setting, which defaults to 1,000 seconds.
Example
- Create a UDTF.
CREATE FUNCTION py_generate_series(start int, endnum int, step int) RETURNS TABLE(a int) LANGUAGE python RUNTIME_VERSION='3.11.2' HANDLER='generate_series' as $$ def generate_series(start, endnum, step): current = start while current <= endnum: yield current current += step $$; - Execute the UDTF.
SELECT py_generate_series(1,4,1); py_generate_series ---------------------- 1 2 3 4 (4 rows)
Parent topic: UDF Development (Python)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot