/
Columns Replace directive
Columns Replace directive
The COLUMNS-REPLACE directive alters column names in bulk.
Syntax
columns-replace 'sed-expression'
The 'sed-expression'
specifies the sed expression syntax, such as s/data_//g
.
Example
Using this record as an example, these columns all have data_
as a prefix in their column names:
{
"data_name": "root",
"data_first_name": "mars",
"data_last_name": "joltie",
"data_data_id": 1,
"data_address": "150 Mars Ave, Mars City, Mars, 8899898",
"mars_ssn": "MARS-456282"
}
Applying this directive:
columns-replace 's/^data_//g'
results in the record having any column names that were prefixed with data_
replaced with an empty string:
{
"name": "root",
"first_name": "mars",
"last_name": "joltie",
"data_id": 1,
"address": "150 Mars Ave, Mars City, Mars, 8899898",
"mars_ssn": "MARS-456282"
}
Note: The field value is untouched during this directive. This operates only on the column names.
, multiple selections available,
Related content
Filter Row If Matched directive
Filter Row If Matched directive
Read with this
NGramTransform Spark Compute Analytics (Deprecated)
NGramTransform Spark Compute Analytics (Deprecated)
More like this
Set Column directive
Set Column directive
Read with this
Hive Bulk Import Action (Deprecated)
Hive Bulk Import Action (Deprecated)
More like this
Cleanse Column Names directive
Cleanse Column Names directive
Read with this
Google Sheets Batch Source
Google Sheets Batch Source
More like this
Created in 2020 by Google Inc.