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

Support for table functions #9228

Closed
buremba opened this issue Sep 13, 2021 · 3 comments
Closed

Support for table functions #9228

buremba opened this issue Sep 13, 2021 · 3 comments

Comments

@buremba
Copy link
Member

buremba commented Sep 13, 2021

In some SQL databases (Postgresql, Oracle, etc.), it's valid to call functions in FROM. Here is an example query:

SELECT count(*) from generate_series(0, 100)

The feature is useful for generating random data or dynamically returning datasets from Java UDFs.

My understanding is that we need to implement the following features to support table functions:

  1. Support for calling functions in Relation node of SQL dialect.
  2. Support for returning RowType for scalar functions.

If there is interest, I can implement 1 as a start, what do you think?

@buremba
Copy link
Member Author

buremba commented Sep 13, 2021

Closing as this is duplicate of #1839 .

@buremba buremba closed this as completed Sep 13, 2021
@findepi
Copy link
Member

findepi commented Sep 13, 2021

For this specific example, you can write the following in Trino

SELECT count(*) FROM UNNEST(sequence(0, 100));

Support for returning RowType for scalar functions.

A scalar function can return a Row today.

Support for calling functions in Relation node of SQL dialect.

Do you mean feature called "Polymorphic Table Functions"?
I think you already found #1839

@buremba
Copy link
Member Author

buremba commented Sep 13, 2021

Yes, that was what I'm looking for. :) I searched for the keyword table functions but missed that issue so wanted to create one. @ebyhr guided me so closed the issue in favor of #1839.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants