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.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group