Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services Amazon Athena中的配置单元\u元数据无效_Amazon Web Services_Amazon Athena_Aws Glue_Aws Pinpoint - Fatal编程技术网

Amazon web services Amazon Athena中的配置单元\u元数据无效

Amazon web services Amazon Athena中的配置单元\u元数据无效,amazon-web-services,amazon-athena,aws-glue,aws-pinpoint,Amazon Web Services,Amazon Athena,Aws Glue,Aws Pinpoint,我如何解决Amazon Athena中的以下错误 配置单元\u无效\u元数据:com.facebook.presto.HIVE.DataCatalogException:错误::应位于“struct”的位置8,但找到了“-”。服务:空;状态代码:0;错误代码:空;请求ID:null 当查看连接到AWS Glue生成的Athena的数据库表中的位置8时,我可以看到它有一个名为attributes的列,该列具有相应的结构数据类型: struct < x-amz-request-id:s

我如何解决Amazon Athena中的以下错误

配置单元\u无效\u元数据:com.facebook.presto.HIVE.DataCatalogException:错误::应位于“struct”的位置8,但找到了“-”。服务:空;状态代码:0;错误代码:空;请求ID:null

当查看连接到AWS Glue生成的Athena的数据库表中的位置8时,我可以看到它有一个名为attributes的列,该列具有相应的结构数据类型:

struct <
    x-amz-request-id:string,
    action:string,
    label:string,
    category:string,
    when:string
>
同一文件中的第二个事件:

{
    "event_type": "DocumentHandling",
    "event_timestamp": 1524835194932,
    "arrival_timestamp": 1524835200692,
    "event_version": "3.1",
    "application": {
        "app_id": "[an app id]",
        "cognito_identity_pool_id": "[a pool id]",
        "sdk": {
            "name": "Mozilla",
            "version": "5.0"
        }
    },
    "client": {
        "client_id": "[a client id]",
        "cognito_id": "[a cognito id]"
    },
    "device": {
        "locale": {
            "code": "en_GB",
            "country": "GB",
            "language": "en"
        },
        "make": "generic web browser",
        "model": "Unknown",
        "platform": {
            "name": "macos",
            "version": "10.12.6"
        }
    },
    "session": {},
    "attributes": {
        "action": "Button-click",
        "label": "FavoriteStar",
        "category": "Navigation"
    },
    "metrics": {
        "details": 40.0
    },
    "client_context": {
        "custom": {
            "legacy_identifier": "50ebf77917c74f9590c0c0abbe5522d2"
        }
    },
    "awsAccountId": "[aws account id]"
}
接下来,AWS Glue生成了一个数据库和一个表。具体来说,我看到有一个名为attributes的列,其值为

struct <
    x-amz-request-id:string,
    action:string,
    label:string,
    category:string,
    when:string
>
我得到了前面描述的错误消息


旁注,我试图通过从Glue中编辑数据库表来删除attributes字段,但在从Athena执行SQL查询时会导致内部错误。

这是一个已知的限制。Athena表和数据库名称只允许下划线特殊字符

Athena表和数据库名称不能包含特殊字符,下划线除外。
来源:

当表名的名称中有-时,使用勾号` 例子: 从“精确定位测试”中选择*。“精确定位测试消防软管”限值10


确保在左窗格中选择了默认数据库

我认为问题在于您的结构元素名称:x-amz-request-id 以这个名字。 我目前正在处理一个类似的问题,因为我的struct中的元素名称中有::。 样本数据:

some_key: {
  "system::date": date,
  "system::nps_rating": 0
}
它试图用以下方式将派生结构模式转义:

struct <
    system\:\:date:String
    system\:\:nps_rating:Int
>
但这仍然给了我雅典娜的一个错误。 除了将Struct更改为STRING并尝试以这种方式处理数据之外,我没有一个很好的解决方案

some_key: {
  "system::date": date,
  "system::nps_rating": 0
}
struct <
    system\:\:date:String
    system\:\:nps_rating:Int
>