【发布时间】:2021-10-25 09:24:13
【问题描述】:
我正在尝试连接到 AWS Athena 并执行选择查询。我为此使用了 athena-express 包。这是以下错误。
错误:TypeError:无法读取未定义的属性“流” 在 AthenaExpress.query
Here is the sample code:
const AthenaExpress = require("athena-express");
const aws = require("aws-sdk");
const awsCredentials = {
accessKeyId: "AccesskeyHere",
secretAccessKey: "secretkeyHere",
region: "regionHere",
};
aws.config.update(awsCredentials);
const athenaExpressConfig = { aws,getStats: true,s3:"s3URI" }; //configuring athena-express with aws sdk object
const athenaExpress = new AthenaExpress(athenaExpressConfig);
(async () => {
let query = {
sql: "SELECT * FROM table where vin='123' and date like '%2021-08%'",
db: "databasename"
};
try {
let results = await athenaExpress.query(query);
console.log(results);
} catch (error) {
console.log(error);
}
})();
Here is the error:
Error: TypeError: Cannot read property 'Stream' of undefined
at AthenaExpress.query
at async eval
请告诉我如何解决这个问题?
【问题讨论】:
标签: javascript node.js cypress amazon-athena