Skip to content

Commit

Permalink
replace all occurrences of __QUESTION_MARK__ with ?
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyEe committed Sep 12, 2024
1 parent c33ffbf commit 2e8ba38
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ const readline = require("readline"),
let s3Metadata = null;

function startQueryExecution(config) {
let queryString = SqlString.format(config.sql, config.QueryParams || []);
queryString = queryString.replace(/__QUESTION_MARK__/g, "?");
const params = {
QueryString: SqlString.format(config.sql, config.QueryParams || []),
QueryString: queryString,
WorkGroup: config.workgroup,
ResultConfiguration: {
OutputLocation: config.s3Bucket,
Expand Down Expand Up @@ -95,7 +97,7 @@ async function getQueryResultsFromS3(params) {
};

const queryResults = await params.config.athena.getQueryResults(
paginationParams
paginationParams,
);
if (params.config.formatJson) {
return {
Expand Down Expand Up @@ -184,12 +186,12 @@ async function cleanUpDML(input, ignoreEmpty) {
})
.on("data", (data) => {
cleanJson.push(
addDataType(JSON.parse(data.toString("utf8")), dataTypes)
addDataType(JSON.parse(data.toString("utf8")), dataTypes),
);
})
.on("finish", function () {
resolve(cleanJson);
})
}),
);
});
}
Expand Down Expand Up @@ -261,15 +263,15 @@ function validateConstructor(init) {
throw new TypeError("Config object not present in the constructor");
if (!init.athena)
throw new TypeError(
"Athena object not present or incorrect in the constructor"
"Athena object not present or incorrect in the constructor",
);
if (!init.s3)
throw new TypeError(
"S3 object not present or incorrect in the constructor"
"S3 object not present or incorrect in the constructor",
);
if (!init.s3Bucket)
throw new TypeError(
"S3 bucket and prefix not present or incorrect in the constructor"
"S3 bucket and prefix not present or incorrect in the constructor",
);
}

Expand Down

0 comments on commit 2e8ba38

Please sign in to comment.