Documentation Index
Fetch the complete documentation index at: https://docs.risingwave.com/llms.txt
Use this file to discover all available pages before exploring further.
Define a struct type
Syntax:STRUCT< >
Struct types are declared using the angle brackets (< and >).
Starting from v2.7.0, RisingWave supports empty struct types, allowing you to define a struct with zero fields, serving as a placeholder for potential future additions of fields. To declare an empty struct, include a space between the angle brackets
< >. This prevents conflicts with the <> (not equal) operator during SQL parsing.Examples
The statement below creates a tablex that contains struct a, which contains two nested columns (b and c) that are both integers.
y that contains struct a, which contains another struct c.
Add values to a struct
To add values to structs, enclose the nested data with() in the SQL statement. For example, (1, true). Alternatively, you can also use ROW(1, true).
Examples
The statement below adds values to tablex.
y.
trip.
Retrieve data in a struct
To retrieve data in a struct, enclose the struct name with() and use the dot operator to specify the nested column. For example, to access the initial_charge column under fare in the trip schema, use (fare).initial_charge.