Create Record directive
The CREATE-RECORD directive was introduced in CDAP 6.7.0.
The CREATE-RECORD directive creates a record column with nested values by copying values from source columns into a destination column.
Syntax
create-record :target_column :columns [,:columns]*
Usage notes
A RECORD can be accessed as a STRUCT type in standard SQL. A STRUCT is a container of ordered fields.
Example
Using this record as an example:
{
"id": 1,
"timestamp": 1234434343,
"measurement": 10.45,
"isvalid": true
}Applying this directive:
create-record :list :id, :timestamp, :measurement, :isvalidresults in this record:
{
"id": 1,
"timestamp": 1234434343,
"datetime": 1234434343,
"measurement": 10.45,
"isvalid": true,
"list": {"id":1,"timestamp":1234434343,"measurement":10.45,"isvalid":true}
}
Created in 2020 by Google Inc.