/
Write as JSON object directive
Write as JSON object directive
The WRITE-AS-JSON-OBJECT directive composes a JSON object based on the fields specified and writes it to the destination column.
Syntax
write-as-json-object :column [col [ ,col]*]
The column
will contain a JSON object composed of all the fields specified in the col
.
Usage Notes
The WRITE-AS-JSON-OBJECT directive composes a JSON Object based on the fields or columns specified to be added to the object.
Depending on the type of object a field is holding, it will be transformed appropriately to the JSON types. NULL are also handled and converted to JsonNull.
Example
Using this record as an example:
{
"number": 1,
"text": "this, is a string.",
"height" : 1.5,
"weight" : 1.67,
"address" : null
}
And applying this directive:
write-as-json-object body number,text,height,address
would result in this record:
{
"body": { "number":1, "text": "this, is a string.", "height" : 1.5, "address" : null },
"number": 1,
"text": "this, is a string.",
"height" : 1.5,
"weight" : 1.67,
"address" : null
}
, multiple selections available,
Related content
Write as JSON Map directive
Write as JSON Map directive
Read with this
Parse as JSON directive
Parse as JSON directive
Read with this
Create Record directive
Create Record directive
Read with this
Set Column directive
Set Column directive
Read with this
Directives
Directives
Read with this
Flatten directive
Flatten directive
Read with this
Created in 2020 by Google Inc.