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.
I am new to javascript and Athena . However trying to use athena-express with a nodejs Lambda to execute Athena Query. I am trying to enable waitForResults and get the QueryExecutionId so that I can fetch the results afterwards. I tried following code but not working..! it seems stuck at result = await p1; . As per the documentation it should return the QueryExecutionId without any latency. Appreciate any help here.
const AE = require("athena-express");
var aws = require("aws-sdk");
async function getAthenaData(query) {
console.log(" query == " + query);
const athenaExpressConfig = {
aws,
s3: "s3://sb-mydata-nonprod-logs/results",
getStats: true,
workgroup: "primary",
retry: 1000,
waitForResults: false
};
const athenaExpress = new AE(athenaExpressConfig);
let p1 = athenaExpress.query(query);
let result = "empty Query Execution ID";
console.log(" Start resolve Promise");
result = await p1;
console.log(" Results after Promise === " + result);
console.log(" End resolve Promise");
}
I am new to javascript and Athena . However trying to use athena-express with a nodejs Lambda to execute Athena Query. I am trying to enable
waitForResults
and get the QueryExecutionId so that I can fetch the results afterwards. I tried following code but not working..! it seems stuck atresult = await p1;
. As per the documentation it should return the QueryExecutionId without any latency. Appreciate any help here.