Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabular SQL UDFs (UDTFs) #5731

Open
BohuTANG opened this issue Jun 2, 2022 · 5 comments
Open

Tabular SQL UDFs (UDTFs) #5731

BohuTANG opened this issue Jun 2, 2022 · 5 comments
Labels
A-query Area: databend query C-function Category: Functions community-take good first issue Category: good first issue

Comments

@BohuTANG
Copy link
Member

BohuTANG commented Jun 2, 2022

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

@BohuTANG BohuTANG added A-query Area: databend query good first issue Category: good first issue C-function Category: Functions labels Jun 2, 2022
@BohuTANG BohuTANG mentioned this issue Jun 2, 2022
@GrapeBaBa
Copy link
Contributor

GrapeBaBa commented Jun 2, 2022

/assignme

@GrapeBaBa
Copy link
Contributor

@BohuTANG which parser should I use for this feature, v1 or v2?

@BohuTANG
Copy link
Member Author

BohuTANG commented Jul 9, 2022

@BohuTANG which parser should I use for this feature, v1 or v2?

Please use v2, v2 will enabled by default soon.

@BohuTANG
Copy link
Member Author

Hi @GrapeBaBa ,
How is this going or any questions?

@GrapeBaBa
Copy link
Contributor

@BohuTANG I am busy in own job these two weeks. I can spend some time to do this task from this week, however if it is a high priority task, feel free to take it back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query Area: databend query C-function Category: Functions community-take good first issue Category: good first issue
Projects
None yet
3 participants