nayan_wylde
Esteemed Contributor II

Currently Serverless supports only scaler valued function not table valued function. also you need to provide the catalog and schema in the function.

You can create using a pro compute

create function {catalog_name}.{schema_name}._rrr_taxonomy_test()
RETURNS TABLE(dept string, cat string, subcat string)
LANGUAGE PYTHON
AS
$$
= '''select
custom_department as dept,
custom_category as cat,
coalesce(custom_sub_category, '') as subcat
from item'''
 
return spark.sql(s)
$$
 
 
I tried this function in serverless and it worked it is a scaler valued function.
 
create function {catalog_name}.{schema_name}._rrr_taxonomy_test_1()
RETURNS string
LANGUAGE PYTHON
AS
$$
= '"Hello World"
 
 
return s
$$