-
Notifications
You must be signed in to change notification settings - Fork 302
Table Value Function en
谷深 edited this page Dec 16, 2022
·
1 revision
Havenask supports table-valued functions (TVFs).
In a SQL statement, you can use a TVF to perform an operation on a table. The inputs of a TVF include one or more scalar parameters and a SQL statement that specifies a table. The output of a TVF is a table.
SELECT:
SELECT [ DISTINCT ]
{ * | projectItem [, projectItem ]* }
FROM Table({TVF})
[ WHERE booleanExpression ]
[ GROUP BY { groupItem [, groupItem ]* } ]
[ ORDER BY { orderByItem [, OrderByItem ]* }]
[ HAVING booleanExpression ]
[ LIMIT number]
[ OFFSET number]
TVF:
{TVF Name}({scalar parameter}*, {SELECT})
SELECT
*
FROM
TABLE (
one_part_tvf(
'rtp_url',
123,
(
SELECT i1, i2, d3, d4 FROM t1
)
)
)
You cannot specify nested TVFs in the following format:
SELECT
*
from
TABLE (
tvf1(
tvf2(
(
select
*
from
t1
)
)
)
)
You can specify nested TVFs in the following format:
SELECT
*
FROM
TABLE (
one_part_tvf_enable_shuffle(
'rtp_url',
123,
(
SELECT
i1, i2
FROM
TABLE (
one_part_tvf_enable_shuffle(
'rtp_url_2',
234,
(
SELECT i1, i2, d3, d4 FROM t1
)
)
)
)
)
)