# UDF error Tabular function

**URL:** <https://community.dremio.com/t/udf-error-tabular-function/11860>\
**Category:** Uncategorized\
**Created:** [May 21, 2024, 4:14pm UTC](https://community.dremio.com/t/udf-error-tabular-function/11860 "2024-05-21T16:14:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arnie](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Arnie](https://community.dremio.com/u/Arnie)\
**Post date:** [May 21, 2024, 4:14pm UTC](https://community.dremio.com/t/udf-error-tabular-function/11860/1 "2024-05-21T16:14:07Z")

</div>

Hello,  
I’m running DREMIO EE 22.2.3.  
Just copying sample code :

CREATE TABLE $scratch.fruits (name, color)  
AS VALUES (‘strawberry’, ‘red’), (‘banana’, ‘yellow’), (‘raspberry’, ‘red’);  
CREATE FUNCTION red\_fruits()  
RETURNS TABLE (name VARCHAR, color VARCHAR)  
RETURN SELECT \* FROM $scratch.fruits WHERE color = ‘red’;  
SELECT name FROM TABLE (red\_fruits())

copied from Dremio’s page  
[Tabular User-Defined Functions Unveiled | Dremio](https://www.dremio.com/blog/announcing-tabular-user-defined-functions/#h-creating-a-tabular-user-defined-function)

I get an error - is it my release 22.2.3 the source for this error ??

Thanks

PARSE ERROR: Failure parsing the query.

SQL Query CREATE FUNCTION red\_fruits()  
RETURNS TABLE (name VARCHAR, color VARCHAR)  
RETURN SELECT \* FROM $scratch.fruits WHERE color = ‘red’  
startLine 2  
startColumn 13  
endLine 2  
endColumn 17  
SQL Query CREATE FUNCTION red\_fruits()  
RETURNS TABLE (name VARCHAR, color VARCHAR)  
RETURN SELECT \* FROM $scratch.fruits WHERE color = ‘red’

(org.apache.calcite.sql.parser.SqlParseException) Encountered “TABLE” at line 2, column 13.  
Was expecting one of:  
“CHARACTER” …  
“CHAR” …  
“VARCHAR” …  
“DATE” …  
“TIME” …  
“TIMESTAMP” …  
“DECIMAL” …  
“DEC” …  
“NUMERIC” …  
“BOOLEAN” …  
“INTEGER” …  
“INT” …  
“BINARY” …  
“VARBINARY” …  
“TINYINT” …  
“SMALLINT” …  
“BIGINT” …  
“REAL” …  
“DOUBLE” …  
“FLOAT” …  
“ANY” …  
“ROW” …  
“ARRAY” …  
“MULTISET” …  
 …  
\<QUOTED\_IDENTIFIER\> …  
\<BACK\_QUOTED\_IDENTIFIER\> …  
\<BRACKET\_QUOTED\_IDENTIFIER\> …  
\<UNICODE\_QUOTED\_IDENTIFIER\> …

---

<div class="post-metadata">

**Author:** ![Simon\_Ashley](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/simon_ashley/32/4699_2.png) [@Simon\_Ashley](https://community.dremio.com/u/Simon_Ashley)\
**Post date:** [May 21, 2024, 5:21pm UTC](https://community.dremio.com/t/udf-error-tabular-function/11860/2 "2024-05-21T17:21:36Z")

</div>

You are correct, this is version related as Tabular UDF’s i.e. “RETURNS TABLE ( )” was introduced in v24.1.0

See: [24.x Release Notes | Dremio Documentation](https://docs.dremio.com/current/release-notes/version-240-release#2410-release-notes-june-2023)

`In this release, Dremio supports tabular user-defined functions. For more information, see [User-Defined Function](https://docs.dremio.com/current/reference/sql/commands/functions/)`
