Skip to main content

Table-valued functions

A table-valued function (TVF) returns a set of rows. You can use a table-valued function anywhere you can use a table. For example, the generate_series TVF generates a range of numbers as rows. The following code example generates a series of numbers from 1 to 100 and selects each number as x from the resulting series:
SELECT x FROM generate_series(1, 100) r(x);
Read files from object storage with table-valued functions such as read_files (any format, inferred), read_parquet, and read_text; see the list in the sidebar for all supported formats. Use read_stream to consume Kafka streams, and list_objects to explore files on Amazon S3.