Skip to content

Latest commit

 

History

History
30 lines (17 loc) · 725 Bytes

README.md

File metadata and controls

30 lines (17 loc) · 725 Bytes

s3-select-example

Example usage of S3 Select from Go

https://dev.to/mihaichiorean/querying-csv-files-in-aws-s3-from-go-56kf

Command line tool

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)

Install

git clone https://github.com/mihai-chiorean/s3-select-example.git && cd s3-select-example/cmd/s3ql

and run

go install

Usage

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.