ValidateRecord Date Field
Hi Everyone,
I'm trying to use ValidateRecord processor where I have a json input with date field as follows:
{
"name": "sam",
"age": "20",
"dob": "01/01/2004",
"id": "001"
}
In the validaterecord Record Writer Im using JsonRecordSetWriter with the following configuration:

Where I'm using the following avro schema in the Schema Text property:
{
"name": "person_rec",
"type": "record",
"namespace": "nifi.com",
"fields": [
{
"name": "name",
"type": "string"
},
{
"name": "age",
"type": "int"
},
{
"name": "dob",
"type": "int",
"logicalType": "date"
},
{
"name": "id",
"type": "string"
}
]
}
Also I'm setting the Date Format to : MM/dd/yyyy
I though based on the description that when I set the Date Format it will be able to parse the date when reading\writing date fields. I thought by date field it means using logicalType "date" which means the type must be "int" according to avro schema. My expectation is that my validate record will be able to validate against date field as string with the specified format and write it as such however I keep getting error:
Successfully parsed a JSON object from input but failed to convert into a Record object with the given schema
- Caused by: java.lang.NumberFormatException: For input string: "01/01/2004"
Not sure if I miss understanding or missing something here but how this is suppose to work if its expecting string? How the specified Date Format knows what the date field if its not defined as such in the avro schema?
Can someone help please ?
Thanks

