0

我试图弄清楚如何使用 AWS S3 Select,一切看起来都很简单,但是下面的查询就是不想工作:
select r.value from S3Object[*].outputs.private_subnets r
上面的返回Invalid Path component.

这是我正在使用的 JSON:

{
    "outputs": {
        "private_subnets": {
            "value": [
                "subnet-1",
                "subnet-2",
                "subnet-3"
            ],
            "type": [
                "tuple",
                [
                    "string",
                    "string",
                    "string"
                ]
            ]
        },
        "public_subnets": {
            "value": [
                "subnet-1",
                "subnet-2",
                "subnet-3"
            ],
            "type": [
                "tuple",
                [
                    "string",
                    "string",
                    "string"
                ]
            ]
        },
        "vpc_id": {
            "value": "vpc-123",
            "type": "string"
        }
    }
}

我只是不明白错误,是valueSQL中的特殊词吗?
这是我到目前为止尝试过的
select r from S3Object[*].outputs.private_subnets r

{
    "r": {
        "value": [
            "subnet-1",
            "subnet-2",
            "subnet-3"
        ],
        "type": [
            "tuple",
            [
                "string",
                "string",
                "string"
            ]
        ]
    }
}

select r.type from S3Object[*].outputs.private_subnets r

{
    "type": [
        "tuple",
        [
            "string",
            "string",
            "string"
        ]
    ]
}

所以我只是不明白有什么问题value

4

1 回答 1

2

您无法选择此项,因为“值”是保留关键字。 https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference-keyword-list.html。这可以使用值周围的双引号进行转义。

于 2019-07-26T17:29:01.640 回答