athena2csv

command module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 14 Imported by: 0

README

CircleCI

Overview

This tool can download an Athena SQL query results in CSV format.

Installation

Using Homebrew:

$ brew tap flowerinthenight/tap
$ brew install athena2csv

If you have a Go environment:

$ go get -u -v github.com/flowerinthenight/athena2csv

Run the tool

Running this tool will create an S3 bucket queryathena2csv-query-bucket.

Required environment variables:

# The following should have at least Athena read and S3 read/write access.
AWS_REGION={your-aws-region}
AWS_ACCESS_KEY_ID={aws-key-id}
AWS_SECRET_ACCESS_KEY={aws-secret}

If your query string is quite long, you can write it in a file:

$ athena2csv --database aws-billing --query-file query.txt

If your query is not that long, you can input directly in command line:

$ athena2csv --database aws-billing "select \"identity/lineitemid\" \
      from \"aws_billing\".\"mobingilabs_aws_billing_formatted_development\" \
      limit 10"

Output file is downloaded to the current directory, named output.csv.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL