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
181 stars 70 forks source link

Tab delimited responses are truncated #78

Open timeoverride opened 2 years ago

timeoverride commented 2 years ago

In my case I'm using MSCK REPAIR TABLE. The request returns a list of partitions I need to manually add (manually in that Athena is unable to automatically add them). I'm writing a small application that will parse the tab delimited query result and add the missing partitions, however the result is being truncated by athena-express in helper.js:249-254.

                    case line.indexOf("\t") > 0:
                        line = line.split("\t");
                        cleanJson.push({
                            [line[0].trim()]: line[1].trim(),
                        });
                        break;                    

It would be great (for me at least) if we could just return the split line. Ex:

                    case line.indexOf("\t") > 0:
                        cleanJson = line.split("\t");
                        break;

I'd like to understand the reason why an object is being pushed to the return array containing the first two values as a key/value pair rather than returning the full value of the tab delimited response.

Thanks in advance.