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
Source Files ¶
- ddl_alter.go
- ddl_create_database.go
- ddl_create_table.go
- ddl_ctas.go
- ddl_ctas_with_partition.go
- ddl_cvas.go
- ddl_drop.go
- ddl_msck.go
- ddl_path.go
- dml_insert_into_select.go
- dml_insert_into_values.go
- dml_select_array.go
- dml_select_count.go
- dml_select_db_exec.go
- dml_select_fields.go
- dml_select_geo.go
- dml_select_information_schema.go
- dml_select_join.go
- dml_select_json.go
- dml_select_map.go
- dml_select_prepare.go
- dml_select_row.go
- dml_select_simple.go
- dml_select_star.go
- dml_select_time.go
- dml_values.go
- doc.go
- unsupported.go
- util_desc_table.go
- util_desc_view.go
- util_show.go