Example usage of S3 Select from Go
https://dev.to/mihaichiorean/querying-csv-files-in-aws-s3-from-go-56kf
In this codebase I've also added a very basic command line tool that can be used to run (test?) SQL queries against a CSV in S3.
It will pick up AWS env vars or config file (~/.aws/credentials
)
git clone https://github.com/mihai-chiorean/s3-select-example.git && cd s3-select-example/cmd/s3ql
and run
go install
s3ql --help
s3ql --bucket <bucket> --key FL_insurance_sample.csv --region us-east-2 select \* from s3object s where s.statecode = \'FL\'
Will print out, line by line, the json output of each matched record in the CSV.