Skip to content

Tabular SQL UDFs (UDTFs) #5731

@BohuTANG

Description

@BohuTANG

Summary

A user-defined table function can apply to a SQL query and returns 0, 1, or multi-rows, each result contains 1 or more columns.
A snow style UDTFs:

create function sum_range_func(l int, r int)
  returns table (x integer)
  as 'select sum(a) from test where a > l and a < r'
  ;
  
select * from table(sum_range_func(1,9));

Reference:
Databend scalar UDF: https://databend.rs/doc/reference/sql/ddl/udf/ddl-create-function
Snowflake tabular UDF: https://docs.snowflake.com/en/developer-guide/udf/sql/udf-sql-tabular-functions.html

Metadata

Metadata

Assignees

Labels

good first issueCategory: good first issuestaleIssue has not had recent activity or appears to be solved. Stale issues will be automatically closed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions