A user-defined transform is a user-defined function that returns a set of rows or a stream of rows. Its input arguments can be scalars or cursors. A cursor is an object representing a subquery, which the user-defined transform can use to read the subquery results. The subquery can be relational or streaming.
The following describes the differences between user-defined functions, procedures, and transforms:
SQL: CREATE FUNCTION
Accepts ... Zero or more parameters
Returns ... Scalar value
SQL: CREATE PROCEDURE
Accepts ... Zero or more parameters
Returns ... No values returned A UDP is just a UDF that returns no value; it is evaluated for a side effect.
SQL: CREATE FUNCTION
Accepts ... Zero or more Relations
Returns ... A Streaming Relation
The invocation of a UDX is quite often preceded by the keyword TABLE. For example:
SELECT STREAM *
FROM TABLE(
filterSignal( CURSOR( SELECT STREAM * FROM "RawSignals")));