How to use S3 Select for Nested Parquet Objects

564 views Asked by At

I have dumped data into a parquet file. When I use

SELECT * FROM s3object s LIMIT 1

it gives me the following result.

 {
    "name": "John",
    "age": "45",
    "country": "USA",
    "experience": [{
            "company": {
                "name": "ABC",
                "years": "10",
                "position": "Manager"
            }
        },
        {
            "company": {
                "name": "BBC",
                "years": "2",
                "position": "Assistant"
            }
        }
    ]
}

I want to filter the result where company.name = "ABC" so, the output should be looks like following.

{
    "name": "John",
    "age": "45",
    "country": "USA",
    "experience": [{
            "company": {
                "name": "ABC",
                "years": "10",
                "position": "Manager"
            }
        }
    ]
}

or this

{
    "name": "John",
    "age": "45",
    "country": "USA",
    "experience.company.name": "ABC",
    "experience.company.years": "10",
    "experience.company.position": "Manager"
}

Any support is highly appreciated. Thanks.

0

There are 0 answers