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

External functions on a SQL endpoint

Vegard_Stikbakk
New Contributor II

want to create an external function using CREATE FUNCTION (External) and expose it to users of my SQL endpoint. Although this works from a SQL notebook, if I try to use the function from a SQL endpoint, I get "User defined expression is not supported on a SQL endpoint." Specifically, the function is created by doing this, like the example in the CREATE FUNCTION (External) docs says.

CREATE FUNCTION f1 AS 'SimpleUDF' USING JAR '/dbfs/FileStore/udf.jar'

Screenshot of error message

Screenshot 2022-03-24 at 21.32.59 

The JAR lives in DBFS. Maybe the reason why this doesn't work is that a SQL endpoint doesn't have access to DBFS? I haven't been able to find anything about this, though.

I hope someone can help!

1 ACCEPTED SOLUTION

Accepted Solutions

Hubert-Dudek
Esteemed Contributor III

It is separated runtime https://docs.databricks.com/sql/release-notes/index.html#channels so it seems that it is not yet supported.

There is CREATE FUNCTION documentation but it seems that it is support only SQL syntax https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-create-sql-function.html

View solution in original post

2 REPLIES 2

Hubert-Dudek
Esteemed Contributor III

It is separated runtime https://docs.databricks.com/sql/release-notes/index.html#channels so it seems that it is not yet supported.

There is CREATE FUNCTION documentation but it seems that it is support only SQL syntax https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-create-sql-function.html

Kaniz
Community Manager
Community Manager

Hi @Vegard Stikbakke​ , Were you able to resolve your problem?

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.