Creating USER FUNCTION in specific workspace in dremio

Hello All,

Is there a way to c create UDF that is not mapped to one personal workspace,

CREATE FUNCTION hello()
RETURNS VARCHAR RETURN SELECT 'Hello World!'

@iskidet01 Use a fully qualified path name.

CREATE FUNCTION your_space.path.to.function.hello()
RETURNS VARCHAR RETURN SELECT 'Hello World!

You see all UDFs created by querying system table sys.user_defined_functions

Thank @lenoyjacob

Do you know why this not working , I am getting the error ,below

CREATE FUNCTION Samson.Filtertable (x INT) 
RETURNS INT
RETURN SELECT sum(a.Sales) as sum_of_Quantity
FROM Samson."sample superstore" a
where Quantity > x ;

I am using the sample superstore table that has the Sales column

@iskidet01 Can you try to describe Samson."sample superstore" and make sure you see Sales, Is that a VDS on a PDS?

Can you run select * from Samson."sample superstore" and send the profile over?

See the profile
cfe591fb-43db-459e-86a3-db0f2fc07a4a.zip (15.9 KB)
See the describe

@iskidet01 I agree I see sales, what happens if you run just the select?

SELECT sum(a.Sales) as sum_of_Quantity
FROM Samson."sample superstore" a
where Quantity > x ;


29a05d8c-5d2d-43be-9833-4d9e4acab966.zip (7.5 KB)

@iskidet01 I meant just the SQL, what happens if you run the below?

SELECT sum(a.Sales) as sum_of_Quantity
FROM Samson."sample superstore" a
where Quantity > x ;

The query is not going run.

@iskidet01 Sorry my bad, try below

SELECT sum(a.Sales) as sum_of_Quantity
FROM Samson."sample superstore" a
where Quantity > 0

This will definitely run.

I am wondering how this help resolve the issue of user define functions with parameters

@iskidet01 Let me check and get back to you on this

This is a correlated UDF. We fixed a few issues with correlated UDFs in the upcoming release.