Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/src/main/sphinx/functions/table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Table functions
A table function is a function returning a table. It can be invoked inside the
``FROM`` clause of a query::

SELECT * FROM my_function(1, 100)
SELECT * FROM TABLE(my_function(1, 100))

The row type of the returned table can depend on the arguments passed with
invocation of the function. If different row types can be returned, the
Expand Down Expand Up @@ -33,8 +33,8 @@ Every table function is provided by a catalog, and it belongs to a schema in
the catalog. You can qualify the function name with a schema name, or with
catalog and schema names::

SELECT * FROM schema_name.my_function(1, 100)
SELECT * FROM catalog_name.schema_name.my_function(1, 100)
SELECT * FROM TABLE(schema_name.my_function(1, 100))
SELECT * FROM TABLE(catalog_name.schema_name.my_function(1, 100))

Otherwise, the standard Trino name resolution is applied. The connection
between the function and the catalog must be identified, because the function
Expand All @@ -51,15 +51,15 @@ There are two conventions of passing arguments to a table function:

- **Arguments passed by name**::

SELECT * FROM my_function("row_count" => 100, "column_count" => 1)
SELECT * FROM TABLE(my_function("row_count" => 100, "column_count" => 1))

In this convention, you can pass the arguments in arbitrary order. Arguments
declared with default values can be skipped. Argument names are resolved
case-sensitive, and with automatic uppercasing of unquoted names.

- **Arguments passed positionally**::

SELECT * FROM my_function(1, 100)
SELECT * FROM TABLE(my_function(1, 100))

In this convention, you must follow the order in which the arguments are
declared. You can skip a suffix of the argument list, provided that all the
Expand Down