FieldMapper transform plugin

Description

Add input schema and output schema mapping.

Options

name type required default value
field_mapper Object yes

field_mapper [config]

Specify the field mapping relationship between input and output

common options [config]

Transform plugin common parameters, please refer to Transform Plugin for details.

Example

The data read from source is a table like this:

id name age card
1 Joy Ding 20 123
2 May Ding 20 123
3 Kin Dom 20 123
4 Joy Dom 20 123

We want to delete age field and update the filed order to id, card, name and rename name to new_name. We can add FieldMapper transform like this

  1. transform {
  2. FieldMapper {
  3. source_table_name = "fake"
  4. result_table_name = "fake1"
  5. field_mapper = {
  6. id = id
  7. card = card
  8. name = new_name
  9. }
  10. }
  11. }

Then the data in result table fake1 will like this

id card new_name
1 123 Joy Ding
2 123 May Ding
3 123 Kin Dom
4 123 Joy Dom

Changelog

new version

  • Add Copy Transform Connector