gpt4 book ai didi

amazon-web-services - 通过 Terraform 创建的 AWS Glue 中的无效架构错误

转载 作者:行者123 更新时间:2023-12-04 14:06:36 27 4
gpt4 key购买 nike

我在 Terraform 中有一个 Kinesis Firehose 配置,它从 JSON 中的 Kinesis 流读取数据,使用 Glue 将其转换为 Parquet 并写入 S3。
数据格式转换有问题,我收到以下错误(删除了一些细节):

{"attemptsMade":1,"arrivalTimestamp":1624541721545,"lastErrorCode":"DataFormatConversion.InvalidSchema","lastErrorMessage":"Theschema is invalid. The specified table has no columns.","attemptEndingTimestamp":1624542026951,"rawData":"xx","sequenceNumber":"xx","subSequenceNumber":null,"dataCatalogTable":{"catalogId":null,"databaseName":"db_name","tableName":"table_name","region":null,"versionId":"LATEST","roleArn":"xx"}}


我正在使用的 Glue Table 的 Terraform 配置如下:
resource "aws_glue_catalog_table" "stream_format_conversion_table" {
name = "${var.resource_prefix}-parquet-conversion-table"
database_name = aws_glue_catalog_database.stream_format_conversion_db.name

table_type = "EXTERNAL_TABLE"

parameters = {
EXTERNAL = "TRUE"
"parquet.compression" = "SNAPPY"
}

storage_descriptor {
location = "s3://${element(split(":", var.bucket_arn), 5)}/"
input_format = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat"
output_format = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat"

ser_de_info {
name = "my-stream"
serialization_library = "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe"

parameters = {
"serialization.format" = 1
}
}
columns {
name = "metadata"
type = "struct<tenantId:string,env:string,eventType:string,eventTimeStamp:timestamp>"
}
columns {
name = "eventpayload"
type = "struct<operation:string,timestamp:timestamp,user_name:string,user_id:int,user_email:string,batch_id:string,initiator_id:string,initiator_email:string,payload:string>"
}
}
}
这里需要改变什么?

最佳答案

我遇到了“架构无效。指定的表没有列”的组合如下:

  • Glue 架构注册表中的 avro 架构,
  • 使用“从现有模式添加表”通过控制台创建的粘合表
  • kinesis data firehose 配置了 Parquet 转换并引用了从架构注册表创建的胶水表。

  • 事实证明,如果表是从现有架构创建的,则 KDF 无法读取表的架构。必须从头开始创建表(与“从现有模式添加表”相反)这没有记录......现在。

    关于amazon-web-services - 通过 Terraform 创建的 AWS Glue 中的无效架构错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68125501/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com