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.
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.