'Data Type Error when mapping in Azure Data Factories

While trying to map my fields for a data pipeline in Azure data factory, I run into this error. Operation on target Copy Opportunities failed: ErrorCode=UserErrorSchemaMappingCannotInferSinkColumnType,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Data type of column 'MARKET' can't be inferred from 1st row of data, please specify its data type in mappings of copy activity or structure of DataSet.,Source=Microsoft.DataTransfer.Common,'

I am pretty certain the error is coming from the fact that I have multiple fields that use a JSON path which parses through my JSON with no specified data type. An example of that is below.

$..CUSTOMFIELDS[?(@.FIELD_NAME ==  'OPPORTUNITY_FIELD_1')][0].FIELD_VALUE


Solution 1:[1]

If your pipeline will consume only the same type of file then you can add mappings in your activity, that will tell you what datatype it is reading from your file

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pratik Somaiya