I have an Azure data factory pipeline which defines data imports from CSV files to SQL server database tables. Some of the tables have nullable datetime fields and the CSV files supply nulls as "null" (i.e. within quotes). However, when I run the pipeline, I'm getting several errors failing to convert 'null' to datetime.
I've checked the Azure documentation which states that you can define how null values are presented in the CSV file. Currently, I have the following configuration:
"type": "AzureBlob",
"linkedServiceName": "AzureStorageLinkedService",
"typeProperties": {
"folderPath": "processingtransactions/",
"format": {
"type": "TextFormat",
"columnDelimiter": ",",
"quoteChar": "\"",
"nullValue": "null",
"firstRowAsHeader": true
}
},
However, I'm still getting the error:
"Message=Column 'DateOfBirth' contains an invalid value 'null'. Cannot convert 'null' to type 'DateTime'.,Source=Microsoft.DataTransfer.Common,''Type=System.FormatException,Message=The string was not recognized as a valid DateTime."
I've also tried changing the configuration to: "NullValue": "null" and "nullValue": "NULL"
But I'm still getting the same error. The only way I've managed to get the data to import is to replace all the "null" values in the CSV file with "" (empty string) but this isn't ideal.
Does anyone know what syntax I need to get the import to accept the "null" string?