If the field name has trailing white spaces in CSV header then CsvProducer raises a NoSuchColumnException,
If the header line of your CSV file is one of the following
1 "ID,NAME"
2 " ID,NAME"
3 "ID ,NAME"
then the third one produces a NoSuchColumnException
all it needs to fix it is to replace the line 117 of CsvProducer class
from
columns[i] = new Column((String) readColumns.get(i), DataType.UNKNOWN);
to
columns[i] = new Column(((String) readColumns.get(i)).trim(), DataType.UNKNOWN);
Thanks for reporting and providing the fix.
Commit 1254.
Would be great if you could provide tests for the method. Refactor it mercilessly; it has too much happening in one method.