I have saved column names for file in the hive table which is as below

I have CSV file as below
A|B|C
1|2|3
4|5|6
and I want to match the columns of CSV file with the Column names saved in the table.
The result I want is:
if the file has the same column names as stored in the table to match then do some processing else exit and throw an email of mismatch schema.