Literal expression arguments
When you invoke a UDTF with all literal expression arguments, you
invoke an uncorrelated table function. You can specify
an uncorrelated table function anywhere in a query where a table can
appear. An uncorrelated table function always executes on the host.
Although you can use an uncorrelated table function in most supported
contexts, there are a couple of exceptions where you cannot use it:
- In the catalog because table functions run only on the host or a SPU (in the case of a correlated table function).
- In a materialized view because materialized views use data that is stored on disk.
For the parseNames UDTF, the following query
shows how the function can be invoked as an uncorrelated table function:
mydb.schema(usr1)=> SELECT * FROM TABLE(parseNames('1,2,3,4,5'));
PRODUCT_ID
------------
1
2
3
4
5
(5 rows)Other examples of uncorrelated UDTFs include:
SELECT * FROM mytbl, TABLE(myfunc(1, 2));SELECT * FROM TABLE WITH FINAL(tfunc(1));