0

I am getting started with the s3-select and I am trying to get the count of array size in the inner parquet object. Following example is one entry from the parquet file.

{
  "id" : 12,
  "date" : "2023-07-06"
  "employee": {
    "name": "stack overflow"
    "age" : 12,
    "details" : {
      "address" : "1234 street",
      "friends": [
        {
          "element": {
            "name": "friend1",
            "age": 12
          },
        },
        {
          "element": {
            "name": "friend2",
            "age": 20
          },
        },
        {
          "element": {
            "name": "friend3",
            "age": 10
          },
        }
      ]
    },
    "height": "180cm"
  }
}


I need to select the friends from the details.

  1. How do I get the name of all the friends from the details?
  2. How do I get the total number of friends from the details.friends?

Is there a way out with s3 select? I am trying to run some queries but it gives an error Data source type path is not supported. Please check the service documentation and try again. I can't get things to run

SELECT  * FROM s3object[*].employee[*].details[*].friends[*].element as s 

Can you please guide me to the right direction?

Dipu
  • 1

0 Answers0