TRANSFORM
All functions > ARRAY OF ROWS > TRANSFORM
Transforms an array of rows using a subquery with optional METHOD
Syntax
TRANSFORM( array_of_rows USING ( query ) [ WITH ( KEY = expr, METHOD = expr, IMPORT = expr ) ] )
Notes
- User-facing
TRANSFORMis lowered toTRANSFORM_Ufor every METHOD (UNNEST,LAMBDA,CORRELATED, or default) USINGcarries the body;KEYis a FEATURE expression naming the aggregation key when inference cannot infer it — preferFEATURE 'NAME'over a bare identifierIMPORTbrings extra features into the subquery scope (typicallyARRAY(FEATURE 'f1', FEATURE 'f2', ...)— quoted names; bare identifiers afterFEATUREare not valid syntax)METHODis a VARCHAR literal naming the strategy ('UNNEST','CORRELATED','LAMBDA'); bare identifiers are feature references, not method names
Availability
| Status | Backends |
|---|---|
| Not available | mysql |
See also
Examples
FeatureQL
-- Default UNNEST transformation
RETURN
f1 := TRANSFORM(
ZIP(ARRAY(1, 2, 3) AS value)
USING (RETURN sum_value := SUM(value) FILTER (WHERE value > 1))
)
;Result
| f1 VARBINARY |
|---|
| [{sum_value: 5}] |
On this page