/
Keep directive
Keep directive
The KEEP directive is used to keep specified columns in the record. This is the opposite behavior of the DROP directive.
Syntax
keep :column [,:column]*
column
is the name of a column in the record to be kept.
Usage Notes
After the KEEP directive is applied, the column(s) specified in the directive are preserved, and all other columns are removed from the record.
Example
Using this record as an example:
{
"id": 1,
"timestamp": 1234434343,
"measurement": 10.45,
"isvalid": true
}
Applying this directive:
keep :id,:measurement
results in this record:
{
"id": 1,
"measurement": 10.45
}
, multiple selections available,
Related content
Format Date directive
Format Date directive
Read with this
Router Transformation (Deprecated)
Router Transformation (Deprecated)
More like this
Create Record directive
Create Record directive
Read with this
Parquet Dynamic Partitioned Dataset Sink (Deprecated)
Parquet Dynamic Partitioned Dataset Sink (Deprecated)
More like this
Flatten directive
Flatten directive
Read with this
NGramTransform Spark Compute Analytics (Deprecated)
NGramTransform Spark Compute Analytics (Deprecated)
More like this
Created in 2020 by Google Inc.