public CsvSchema buildCsvSchema ( final Map < String , Object > row ) { CsvSchema . Builder builder = CsvSchema . builder ( ) ; Set < String > fields = row . keySet ( ) ; for ( String field : fields ) { builder . addColumn ( field ) ; } return builder . build ( ) ; }
Extrapolate the CSV columns from the row keys .