Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

CSV Column Sequence Validation for the nifi flow

Highlighted

CSV Column Sequence Validation for the nifi flow

New Contributor

My requirement is to validate the column sequence for the CSV file using the nifi flow. If column sequence is not same, nifi flow should be terminated else it should continue to load data into hive tables using Avro Serialization.

I am thinking to use a variable which can hold a static sequence of csv header. Which can be compared with other variable which will hold csv header sequence for the incoming file. If both variables are equals flow should continue else flow should fail. Or is there any possibility to use ValidateCSV nifi processor to validate the column sequence for the csv file.

Please suggest any creative idea on this. Thank you in advance.

1 REPLY 1

Re: CSV Column Sequence Validation for the nifi flow

ValidateCSV requires a Schema of column types, and ignores the names. Your method of comparing attributes should work fine, especially if the desired CSV header is static, since you can hard-code this into a RouteOnAttribute dynamic property.