The input is a CSV document generated by the CSV Generator Snap. This document contains fields of various data types. Below is a preview of this document:
The Copy Snap is used to create two streams of this document. One stream goes into the Type Converter Snap and the other goes into the Type Inspector Snap. The Type Inspector is not necessarily required in this case but it is used to identify the fields in the document that have the wrong data type. Below is a preview of the output from the Type Inspector Snap:
The field $Deadline has the wrong data type. To correct this the Type Converter Snap is to be used.
Generally, the $ID field is supposed to be integer data type, but in this case since it is a categorical field it should be string data type. This is why the Type Converter Snap is configured to let the $ID field remain a string. The data type of the fields not listed in the Policy properties is automatically converted based on its value.
The Type Converter Snap is configured as shown below:
Based on its configuration, the Snap detects and converts data types. Below is a preview of the output from the Type Converter Snap:
A Type Inspector Snap is used downstream to demonstrate that the data type has indeed been converted by the Type Converter Snap. Below is a preview of the output from the Type Inspector Snap:
Download this pipeline.