在 Terraform 中更新 AWS Glue 架构和爬网程序

问题描述

我正在使用 terraform 将数据从 S3 存储桶抓取到 AWS glue 数据库中。但是,爬网会创建一个表,该表的列名分区列名 具有重复项。例如:

name
id
date
name (Partition (0))

有没有办法更新 terraform 代码自动重命名其中一列?现在,代码如下:

resource "aws_glue_catalog_database" "database" {
  name = "MyDatabase"
}

resource "aws_glue_crawler" "crawler" {
  database_name = aws_glue_catalog_database.database.name
  name          = "MyCrawler"
  role          = "iamRole"

  s3_target {
    path = "s3://pathlocation"
  }

#Some code to update glue database

#Some code to update crawler

在“配置爬虫的输出页面中进行此更新后,我还需要更新 glue 爬虫: 当爬网程序检测到数据存储中的架构更改时,AWS glue 应如何处理数据目录中的表更新?'

  • 选择“忽略更改且不更新数据目录中的表”选项,然后选择“下一步”

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)