query

command
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

The examples/query folder contains integration tests for all SQL statements, data types supported and unsupported by AWS Athena. How to prepare integration end-to-end test?

1. Prerequisites - AWS Credentials & S3 Query Result Bucket.

To be able to query AWS Athena, you need to have an AWS account at Amazon AWS's website. To give it a shot, a free tier account is enough. You also need to have a pair of AWS access key ID and secret access key. You can get it from AWS Security Credentials section of Identity and Access Management (IAM). If you don't have one, please create it.

In addition to AWS credentials, you also need an s3 bucket to store query result. Just go to AWS S3 web console page to create one. In the examples below, the s3 bucket I use is s3://henrywuqueryresults/.

In most cases, you need the following 4 prerequisites :

S3 Output bucket
access key ID
secret access key
AWS region

For more details on athenadriver's support on AWS credentials & S3 query result bucket, please refer to README section Support Multiple AWS Authorization Methods.

2. Installation athenadriver.

Before Go 1.17, go get can be used to install athenadriver:

go get -u github.com/uber/athenadriver

Starting in Go 1.17, installing executables with go get is deprecated. go install may be used instead.

go install github.com/uber/athenadriver@latest

3. Integration Test.

To Build it:

$cd $GOPATH/src/github.com/uber/athenadriver
$go build examples/query/dml_select_simple.go

Run it and you can see output like:

$./dml_select_simple
https://www.example.com/jobs/433

Jump to

Keyboard shortcuts

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