KoteiIto / node-athena

a nodejs simple aws athena client
MIT License
105 stars 73 forks source link

Boolean typing removed while reading data #62

Open dipasqualew opened 3 years ago

dipasqualew commented 3 years ago

Hi, I wanted to thank for your work. Querying Athena from JS can be cumbersome and your library really helps.

We have encountered an issue with parsing results from Athena queries. In particular, if a Glue column is marked as boolean, the information is lost in translation when parsing the .csv results file.

Typing information is stored in a nearby .csv.metadata file, see: https://docs.aws.amazon.com/athena/latest/ug/querying.html

I don't think the library is parsing any of the typings when reading the results from the CSV, which is mostly ok in JS. Strings are still strings, numbers are properly casted. But Boolean("false") === true and this behaviour can cause very hard-to-track bugs (like the one that lead me here).

I am opening the issue in case you are not aware of the issue.

Cheers