Skip to content

Commit

Permalink
s3 location now supports subfolders
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Arora committed Jan 28, 2019
1 parent 94179a3 commit ad4556b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/athenaExpress.js
Expand Up @@ -137,7 +137,10 @@ function checkIfExecutionCompleted(QueryExecutionId, config) {
function getQueryResultsFromS3(params) {
const s3Params = {
Bucket: params.s3Output.split("/")[2],
Key: params.s3Output.split("/")[3]
Key: params.s3Output
.split("/")
.slice(3)
.join("/")
},
input = params.config.s3.getObject(s3Params).createReadStream(),
lineReader = readline.createInterface({ input });
Expand Down Expand Up @@ -232,8 +235,6 @@ function cleanUpNonDML(lineReader) {
return new Promise(function(resolve, reject) {
lineReader
.on("line", line => {
console.log(line);

switch (true) {
case line.indexOf("\t") > 0:
line = line.split("\t");
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "athena-express",
"version": "3.2.5",
"version": "3.3.0",
"description": "Athena-Express makes it easier to execute SQL queries on Amazon Athena by consolidating & astracting several methods in the AWS SDK",
"main": "./lib/index.js",
"scripts": {
Expand Down

0 comments on commit ad4556b

Please sign in to comment.