【以下的问题经过翻译处理】 使用一张Athena表来存储被分区的Config数据,但是由于“非分区列”的原因,分区没有被创建。
在Athena中显示的错误是:
[ErrorCategory:USER_ERROR,ErrorCode:SYNTAX_ERROR],Detail:FAILED: SemanticException Partition spec {accountid=444453583253,dt=latest,region=us-east-1} contains non-partition columns (分区规范{accountid=444453583253,dt=latest,region=us-east-1}包含非分区列)。
此查询运行在“cost”数据库中,除非通过查询进行限定,请在我们的论坛上发布错误消息,或通过查询ID:a9974a89-2ae7-4416-97de-02a6ee5ee5f2联系客户支持。
外部表的语法如下:
创建外部表aws_config_configuration_snapshot (
文件版本STRING,
配置快照ID STRING,
配置项ARRAY< STRUCT <
configurationItemVersion:字符串,
configurationItemCaptureTime:字符串,
configurationStateId:BIGINT,
awsAccountId:字符串,
configurationItemStatus:字符串,
resourceType:字符串,
resourceId:字符串,
resourceName:字符串,
ARN:字符串,
awsRegion:字符串,
availabilityZone:字符串,
configurationStateMd5Hash:字符串,
configuration:字符串,
supplementaryConfiguration:MAP< STRING, STRING >,
tags:MAP< 字符串, 字符串 >,
resourceCreationTime:字符串> >
)
PARTITIONED BY (dt STRING,region STRING)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
'case.insensitive' = 'false',
'mapping.fileversion' = 'fileVersion',
'mapping.configsnapshotid' = 'configSnapshotId',
'mapping.configurationitems' = 'configurationItems',
'mapping.configurationitemversion' = 'configurationItemVersion',
'mapping.configurationitemcapturetime' = 'configurationItemCaptureTime',
'mapping.configurationstateid' = 'configurationStateId',
'mapping.awsaccountid' = 'awsAccountId',
'mapping.configurationitemstatus' = 'configurationItemStatus',
'mapping.resourcetype' = 'resourceType',
'mapping.resourceid'