s3-select querying data on field name

Question:

I am trying to query data from json data in s3-select.

All these queries work fine and returns the respective object as desired but
when i am trying to search data on name/Car, it doesn’t work.

error: com.amazonaws.services.s3.model.AmazonS3Exception: The column index at line 1, column 32 is invalid.

There is not much related content available on s3-select online.
Wondering whether we can query on field name or not!
There are no examples of select query with where clause for s3-select given in the documentation

Answer:

I can’t find this in any of AWS documentations, but I was just playing around and discovered a working syntax:

Based on some deductions:

  1. I know that syntax like WHERE (‘blah’ in s.tags) work when tags property is an array of string.
  2. AWS documentation also say that s.person[#] should work when # is a valid index/digit. Based on this, I discovered that using star (*) between square bracket, as in s.person[*].Name, also work. This is after failed testing of various syntax like s.Person[], s.Person[#], s.Person[?], etc…

Proof with Python and Boto3:

Weird, I know. Remember to set [default] credentials in ~/.aws/credentials file.

Leave a Reply