ghdna / athena-express

Athena-Express can simplify executing SQL queries in Amazon Athena AND fetching cleaned-up JSON results in the same synchronous or asynchronous request - well suited for web applications.
https://www.npmjs.com/package/athena-express
MIT License
179 stars 70 forks source link

Add flatKeys option parameter #77

Open mary2501 opened 2 years ago

mary2501 commented 2 years ago

Scenario: I have a query with this column header "test (one, two, etc.)" I run the query SELECT field AS "test (one, two, etc.)" from some_table I receive a wrong JSON response because the dot inside the column header is interpreted as a nested array.

In this PR, I added a new config parameter "flatKeys" that fix the issue mentioned above. It is set by default to false in order to be retro compatible

ghdna commented 2 years ago

Interesting issue. Thanks for the PR. I'll review it.