How to validate a record's datatype or change the schema

The Validator step is a helpful step when you want to verify the datatype of the fields in your records or change the schema.

Illustrated in the image below is an example of the buffer source step which is validating the datatype of certain fields in the Validator step before passing to a destination.


The image below is the output from the source step (buffer).

To add the fields you want to validate or change the schema for, click on the the plus icon circled in red under the Designer tab in the Validator step as shown in the below image. You can add the field and select the datatype that you require for that field. The On Invalid field is what you want the result to be if an added field doesn’t have the required properties.

Illustrated in the below image is an example of the error results of the fields that have a different datatype from the specified datatype in the Validator step. In this example, it states that the record was invalid due to 2 fields not having the correct datatype.


NB: To change the datatype of a field, the Field Mapper step or Super Mapper step can be used.