简体   繁体   English

AWS Athena Drop Table + S3 位置

[英]AWS Athena Drop Table + S3 Location

I have a case where I need to drop the table and replace it using lambda functions.我有一种情况需要删除表格并使用 lambda 函数替换它。 So far my first lambda function drops the table with the following SQL Query:到目前为止,我的第一个 lambda function 使用以下 SQL 查询删除表:

DROP TABLE IF EXISTS [dummytable]

I then have a second lambda that deletes the folder where the table existed to prevent "failure_reason": "HIVE_PATH_ALREADY_EXISTS:然后我有第二个 lambda 删除表所在的文件夹以防止“failure_reason”:“HIVE_PATH_ALREADY_EXISTS:

So the second lambda deletes the path: s3://mytablesbucket/dummytable所以第二个lambda删除路径:s3://mytablesbucket/dummytable

Is there a way of achieving this with a single lambda?有没有办法用一个 lambda 来实现这个目标?

Ofcourse Yes.当然是的。 In a single lambda function you can execute multiple statements.在单个 lambda function 中可以执行多个语句。 I am not sure which programming language you are using in lambda. But all languages support this.我不确定你在lambda中使用的是哪种编程语言。但是所有语言都支持这个。

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

相关问题 Azure 相当于 AWS Athena over s3 - Azure Equivalent of AWS Athena over s3 即使 AWS s3 中没有文件,AWS Athena 创建外部表也会成功吗? - AWS Athena create external table succeeds even if AWS s3 doesn't have file in it? 可以为 s3 存储桶子目录创建 athena 表吗? - can athena table be created for s3 bucket sub-directories? 无法在 aws EMR 集群中使用配置单元创建外部表,其中位置指向某个 S3 位置 - Unable to create external table using hive in aws EMR cluster where location pointing to some S3 location AWS Athena 从 GLUE Crawler 输入的表中返回零记录来自 S3 - AWS Athena Return Zero Records from Tables Created by GLUE Crawler input csv from S3 在 AWS Athena 中创建桶表 - create bucket table in AWS Athena 如何使用 AWS Athena 读取加密的 delta 格式的 s3 数据集? - How to read encrypted delta formatted s3 datasets using AWS Athena? 可以从 S3 存储桶子目录创建 AWS athena 分区或列吗? - can AWS athena partition or columns be created from S3 bucket sub-directories? AWS Wrangler Athena 和 S3 read_csv UnicodeDecodeError:“utf-8”编解码器无法解码位置中的字节 0xff - AWS Wrangler Athena and S3 read_csv UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 如何将 AWS DynamoDB 表导出到 S3 存储桶? - How to export an AWS DynamoDB table to an S3 Bucket?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM