Integrating these libraries solves two problems for me:
(1) If you have heterogenous column sets, i.e. one record may have 4 columns, but another record could have 12 columns, the original code will only pull back data from the columns it initially finds. So if there are records with more columns, i.e. if your data model evolves to include more data in the future, this utility will break.
(2) The CSV generation is not robust enough if you have columns that contain hierarchical data with strings. The delimiters would not be properly created.
Integrating these libraries solves two problems for me:
(1) If you have heterogenous column sets, i.e. one record may have 4 columns, but another record could have 12 columns, the original code will only pull back data from the columns it initially finds. So if there are records with more columns, i.e. if your data model evolves to include more data in the future, this utility will break.
(2) The CSV generation is not robust enough if you have columns that contain hierarchical data with strings. The delimiters would not be properly created.