cancel
Showing results for 
Search instead for 
Did you mean: 
Data Governance
cancel
Showing results for 
Search instead for 
Did you mean: 

Turn on UDFs in Databricks SQL feature

DAUR
New Contributor

Hello,

Im using Unity Catalog managed tables and Unity Catalog DLTs. I urgently need to use a UDF in DBSQL because pySpark UDFs dont work in UC. I found this way to create a SQL function and use python language inside:

CREATE FUNCTION redact(a STRING)
RETURNS STRING
LANGUAGE PYTHON
AS $$ 
  return "Hello World"
$$;

I got the error:

Error in SQL statement: AnalysisException: [FEATURE_UNAVAILABLE] Python UDF is not supported in your environment. To use this feature, please contact Databricks Support.

How can I turn on this feature?

1 ACCEPTED SOLUTION

Accepted Solutions

youssefmrini
Honored Contributor III
Honored Contributor III

It will be available soon in public preview. You will need to have a Pro SQL Warehouse or a Serverless SQL Warehouse to use Python UDF in Databricks SQL.

View solution in original post

2 REPLIES 2

fkseki
New Contributor III

If this functionality is available in a private preview, first thing to do is to get in touch with your Databricks representative to ask for your workspace to be included in it

youssefmrini
Honored Contributor III
Honored Contributor III

It will be available soon in public preview. You will need to have a Pro SQL Warehouse or a Serverless SQL Warehouse to use Python UDF in Databricks SQL.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.