简体   繁体   English

是否有 lambda 函数可以根据 s3 中的文件上传读取 Athena 查询

[英]is there a lambda function to read Athena query as per file upload in s3

当文件上传到 s3 存储桶 lambda 必须触发,然后 Athena 应该运行并且基于文件名 Athena 应该将查询传递给 lambda 执行结果

It appears that your goal is to:看来您的目标是:

  • Upload a file to Amazon S3将文件上传到 Amazon S3
  • This file should trigger an AWS Lambda function此文件应触发 AWS Lambda 函数
  • The Lambda function should execute a query on Amazon Athena, using information from the filename of the file that was uploaded Lambda 函数应该使用来自上传文件的文件名的信息在 Amazon Athena 上执行查询
  • It should then return the results of the query to somewhere然后它应该将查询结果返回到某个地方

This is possible, yes.这是可能的,是的。 However, when the Lambda function receives the results from Amazon Athena, it cannot "pass back" the results, since it was triggered by Amazon S3 and there is nowhere to "pass back" those results.但是,当 Lambda 函数从 Amazon Athena 接收结果时,它无法“传回”结果,因为它是由 Amazon S3 触发的,并且无处可“传回”这些结果。 Instead, you might want to store the results in another file in S3.相反,您可能希望将结果存储在 S3 中的另一个文件中。

You would need to write the Lambda function.您需要编写 Lambda 函数。 It can call the Amazon Athena API to run a query and store the results in a new file.它可以调用 Amazon Athena API 来运行查询并将结果存储在新文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM