首页 > 解决方案 > 无法在 AthenaRequest.getResultsStream 的 Request.createReadStream 中读取未定义的属性“流”

问题描述

我正在尝试连接到 AWS Athena 并尝试执行选择查询。我已经为此安装了 athena-client(npm install athena-client),并且我拥有所有必需的权限。这是以下错误。

错误:TypeError:无法读取 AthenaRequest.getResultsStream 的 Request.createReadStream 中未定义的属性“流”。

我用过的代码:

var athena = require("athena-client")
var clientConfig = {
  bucketUri: 's3 uri'
}
var awsConfig = {
  accessKeyId: "accessKeyId",
  secretAccessKey: "secretAccessKey",
  region: "region",
}

var client = athena.createClient(clientConfig, awsConfig)
client.execute('SELECT * FROM db.table', function(err, data) {
  if (err) {
    return console.error(err)
  }
  console.log(data)
})

这是完整的错误:

commands.js:322 TypeError:无法在 AthenaRequest.getResultsStream(VM9 测试:68387)处的 AthenaClient.eval(VM9 测试:68222)处的 Request.createReadStream(VM9 测试:83489)处读取未定义的属性“流”(VM9 测试:68222)在 Generator.next( < 匿名 > ) 已完成(VM9 测试:68088)

标签: javascriptnode.jscypressamazon-athena

解决方案


推荐阅读