Field Renamer
The Field Renamer processor renames fields in a record using the selected method, such as replacing a specified string, removing a prefix, or replacing strings using regular expressions.
You can use multiple rename methods in a single processor. When you specify multiple rename configurations, the processor performs each rename configuration before moving onto the next, in the listed order.
When you configure a rename configuration, you specify the rename method to use and related properties.
Rename Methods
- Replace field name
- Replaces an entire field name. You specify the name of the field to find and the replacement name. Use this method to rename a single field.
- Remove prefix
- Removes a specified prefix. You specify one or more characters to remove from the beginning of field names.
- Remove suffix
- Removes a specified suffix. You specify one or more characters to remove from the end of field names.
- Remove text (any location)
- Removes a set of characters from any location in field names. You specify one or more characters to remove.
- Find and replace by regular expression
- Replaces a set of characters using regular expressions. You specify a regular expression of the pattern to find. The find pattern is case sensitive by default, but you can configure the processor to ignore the case. Then, you specify the pattern for the replacement.
- Find and replace by characters
- Replaces a character with a specified character. You specify the character to find and the replacement character.
- Change case
- Changes the case of all field names. You specify whether field names should be lowercase, upper case, or title case. Title case capitalizes the first letter of each word.
Configuring a Field Renamer Processor
Configure a Field Renamer processor to rename one or more fields in records.
-
In the Properties panel, on the
General tab, configure the following properties:
General Property Description Name Stage name. Description Optional description. Cache Data Caches data processed for a batch so the data can be reused for multiple downstream stages. Use to improve performance when the stage passes data to multiple stages. Caching can limit pushdown optimization when the pipeline runs in ludicrous mode.
-
On the Rename tab, configure the following
properties:
Renamer Property Description Rename Fields Sets of renaming configuration properties. When you define multiple configurations, the processor performs them in the listed order. To define additional configurations, click the Add icon.
You can use simple or bulk edit mode to configure the property. Use bulk edit mode to easily change the configuration order.
Rename Type Method used to rename fields. Select one of the following options: - Replace Field Name - Replaces a field name with a specified field name.
- Remove Prefix - Removes characters from the beginning of field names.
- Remove Suffix - Removes characters from the end of field names.
- Remove Text (any location) - Removes a group of characters from any location in the field names.
- Find and Replace by Regular Expression - Uses regular expressions to find and replace a set of characters.
- Find and Replace by Characters - Replaces a single character in field names.
- Change Case - Changes the case of all field names.
-
Configure additional properties depending on the rename type that you
select:
When using Replace Field Name, configure the following additional properties:
Replace Field Name Property Description Case Insensitive Use to replace field names with non-matching cases, such as replacing storeid
when you specifystoreID
as the field name to replace.By default, the replacement is case sensitive.
Field Name Field name to replace. New Field Name Field name to use for the replacement. When using Remove Prefix, configure the following additional properties:
When using Remove Suffix, configure the following additional properties:Remove Prefix Property Description Case Insensitive Use to remove prefixes with non-matching cases, such as removing West-
when you specifyWEST-
as the prefix to remove.By default, the removal is case sensitive.
Remove Text Characters to remove from the beginning of field names. When using Remove Text (any location), configure the following additional properties:Remove Suffix Property Description Case Insensitive Use to remove suffixes with non-matching cases, such as removing .eu
when you specify.EU
as the suffix to remove.By default, the removal is case sensitive.
Remove Text Characters to remove from the end of field names. When using Find and Replace by Regular Expression, configure the following additional properties:Remove Text Property Description Case Insensitive Use to remove text with non-matching cases, such as removing store
when you specifySTORE
as the text to remove.By default, the removal is case sensitive.
Remove Text Consecutive characters to remove from any location in field names. When using Find and Replace by Characters, configure the following additional properties:Find and Replace by Regular Expression Property Description Case Insensitive Use to replace text with non-matching case. By default, the replacement is case sensitive.
Find Pattern Regular expression that represents the characters that you want to replace. Replace Pattern Regular expression that represents the characters that you want to use in the replacement. When using Change Case, configure the following additional properties:Find and Replace by Characters Property Description Case Insensitive Use to replace text with non-matching case. By default, the replacement is case sensitive.
Find Pattern Single character to replace in field names. Replace Pattern Single replacement character. Change Case Property Description Target Case Case to use for all field names: - Upper case - Changes all characters to uppercase.
- Lower case - Changes all characters to lowercase.
- Title case - Capitalizes the first character of each field name.