cancel
Showing results for 
Search instead for 
Did you mean: 
Data Governance
Join discussions on data governance practices, compliance, and security within the Databricks Community. Exchange strategies and insights to ensure data integrity and regulatory compliance.
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.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!