examples

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: 13 Imported by: 0

README

This folder contains sample code, including integration/stress/crash/demo code, for athenadriver.

For more details, please check 📜 .

Documentation

Overview

The examples folder contains all the integration tests, benchmark tests for package athenadriver.

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/maskcolumn.go

Run it and you can see output like:

$./maskcolumn
2015-01-07T12:00:01.206255Z,xxx
2015-01-07T12:00:01.612598Z,xxx
2015-01-07T12:00:02.793335Z,xxx

Directories

Path Synopsis
The examples/constants folder contains all the const variables used by integration tests in examples folder, so please make sure all credentials are correct for you so that you can run the tests on your own machine.
The examples/constants folder contains all the const variables used by integration tests in examples folder, so please make sure all credentials are correct for you so that you can run the tests on your own machine.
The examples/perf folder contains stress, crash tests for performance and concurrency.
The examples/perf folder contains stress, crash tests for performance and concurrency.
The examples/query folder contains integration tests for all SQL statements, data types supported and unsupported by AWS Athena.
The examples/query folder contains integration tests for all SQL statements, data types supported and unsupported by AWS Athena.

Jump to

Keyboard shortcuts

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