Skip to content

Running Presto queries from the Terminal and saving to a CSV file

License

Notifications You must be signed in to change notification settings

tmickleydoyle/go-presto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Presto for Go

This is a tiny golang client for Facebook's Presto SQL Tool.

Getting Started Example:

go get github.com/tmickleydoyle/go-presto

go-presto -in query_one.sql -out query_one.json -json true

go-presto -in query_one.sql -out query_one.csv -json false

go-presto -in query_one.sql -out query_one.csv

go-presto -in query_one.sql

go-presto -in "SELECT * FROM table" -out query_one.csv

# Renders markdown table
go-presto -in "SELECT * FROM table"

Database connection objects should be included in the ~/.bash_profile:

export PRESTO_USERNAME='username'
export PRESTO_HOST='presto.coordinator.net'
export PRESTO_PORT=8080

Help:

go-presto --help

Usage of go-presto:
  -in string
        input SQL file name
  -json
        indicate if the output should be json
  -out string
        output file name

Go can be installed with Homebrew.

Install Go:

brew install go

About

Running Presto queries from the Terminal and saving to a CSV file

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages