I'm new to Apache Nifi Community and I got stuck at one point - please help me for the below problem :
In Validate CSV processor I'm giving below schema(schema_used) to validate the CSV input. But, processor is showing error(err_screenshot).
Validate CSV - enter image description here
Schema_Used - StrNotNullOrEmpty(), ParseDate("MM/dd/yyyy"), StrNotNullOrEmpty(), StrNotNullOrEmpty(), Optional(), StrNotNullOrEmpty(), StrNotNullOrEmpty(), StrNotNullOrEmpty(), StrNotNullOrEmpty(), Optional(), Optional(), StrNotNullOrEmpty()
The above schema is showing below error - err_screenshot - enter image description here
Note: The Schema is working totally fine, if I remove 'Optional()'.
Problem - Please tell me how can I use 'Validate CSV' processor in Apache Nifi and validate Mandatory/Optional Fields of CSV. Also, suggest/share any script(groovy/python) if that can validate the CSV.
Check documentation: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.25.0/org.apache.nifi.processors.standard.ValidateCsv/additionalDetails.html
Schema property: Null, ParseDate("dd/MM/yyyy"), Optional(ParseDouble()) Meaning: the input CSV has three columns, the first one can be null and has no specification, the second one must be a date formatted as expected, and the third one must a double or null (no value).
You can't use empty cell processors Optional()
.
I don't see input CSV data, so I can only suggest that could solve your problem:
StrNotNullOrEmpty(), ParseDate("MM/dd/yyyy"), StrNotNullOrEmpty(), StrNotNullOrEmpty(), Optional(StrNotNullOrEmpty()), StrNotNullOrEmpty(), StrNotNullOrEmpty(), StrNotNullOrEmpty(), StrNotNullOrEmpty(), Optional(StrNotNullOrEmpty()), Optional(StrNotNullOrEmpty()), StrNotNullOrEmpty()