Skip to content

Commit a6bd307

Browse files
author
Gary Arora
committed
added check for empty column values in every row
1 parent dc62c90 commit a6bd307

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/athenaExpress.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ function getRawResultsFromS3(lineReader) {
197197
}
198198

199199
function cleanUpDML(lineReader) {
200+
200201
let headerList = [],
201202
isFirstRecord = true,
202203
cleanJson = [],
@@ -215,7 +216,9 @@ function cleanUpDML(lineReader) {
215216
singleJsonRow = {};
216217
noOfColumns = line.length;
217218
for (let i = 0; i < noOfColumns; i++) {
218-
singleJsonRow[[headerList[i]]] = line[i];
219+
if(line[i].length) {
220+
singleJsonRow[[headerList[i]]] = line[i];
221+
}
219222
}
220223
cleanJson.push(singleJsonRow);
221224
}
@@ -231,6 +234,8 @@ function cleanUpNonDML(lineReader) {
231234
return new Promise(function(resolve, reject) {
232235
lineReader
233236
.on("line", line => {
237+
console.log(line)
238+
234239
switch (true) {
235240
case line.indexOf("\t") > 0:
236241
line = line.split("\t");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "athena-express",
3-
"version": "3.0.2",
3+
"version": "3.1.0",
44
"description": "Athena-Express makes it easier to execute SQL queries on Amazon Athena by consolidating & astracting several methods in the AWS SDK",
55
"main": "./lib/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)