Skip to content
Developer Edition runs on one host and does not require a product license file. Need multi-host deployment or performance testing at scale? Explore Enterprise Edition

Construct value expression

The construct value expression is an expression used to create constructed data types, such as LIST and RECORD. For information about the list type and record type, see Data types.

Syntax

construct_value_expression
LIST [ value_expression , ] RECORD { field_name : value_expression , }

construct_value_expression ::=
    'LIST' '[' value_expression ( ',' value_expression )* ']'
  | ( 'RECORD' )? '{' ( (field_name ':' value_expression) ( ',' (field_name ':' value_expression) )* )? '}'

Parameters

LIST

Declares to construct a list.

RECORD

Declares to construct a record.

value_expression

The expression that returns a value as an element of a list or as a field value of a record. For more information, see value expression.

field_name

The name of a field in a record. field_name is an identifier. For more information about identifiers, see Rules for naming identifiers.

Examples

Construct a list

RETURN LIST [1,2,3,4,5] AS l

Return:

+-------------+
| l           |
+-------------+
| [1,2,3,4,5] |
+-------------+

Construct a record

RETURN RECORD {a:1, b:true, c:"str literal"} AS record1

Return:

+------------------------------+
| record1                      |
+------------------------------+
| {a:1,b:true,c:"str literal"} |
+------------------------------+