Package: athena-cli
Athena CLIPresto-like CLI tool forAWS Athena. The alternative is using the
AWS CLIAthena sub-commands.RequirementsA recent version of theawsCLI must be available on the PATH.InstallationTo install usingpiprun:$ pip install athena-cliOr, clone the GitHub repo and run:$ python setup.py installConfigurationOnly required configuration is AWS credentials.Usage$ athena --help
usage: athena [--debug] [--execute <statement>] [--output-format <format>] [--schema <schema>]
              [--profile <profile>] [--region <region>] [--s3-bucket <bucket>]
              [--server-side-encryption] [--version]

Athena interactive console

optional arguments:
  -h, --help            show this help message and exit
  --debug               enable debug mode
  --execute STATEMENT   execute statement in batch mode
  --output-format {ALIGNED,VERTICAL,CSV,TSV,CSV_HEADER,TSV_HEADER,NULL}
                        output format for batch mode
  --schema SCHEMA, --database SCHEMA, --db SCHEMA
                        default schema
  --profile PROFILE     AWS profile
  --region REGION       AWS region
  --s3-bucket BUCKET, --bucket BUCKET
                        AWS S3 bucket for query results
  --server-side-encryption, --encryption
                        Use server-side-encryption for query results
  --version             show version info and exitathena> help

Supported commands:
QUIT
SELECT
ALTER DATABASE <schema>
ALTER TABLE <table>
CREATE DATABASE <schema>
CREATE TABLE <table>
CREATE TABLE <table> AS <query>
CREATE [OR REPLACE] VIEW <view> AS <query>
DESCRIBE <table>
DROP DATABASE <schema>
DROP TABLE <table>
MSCK REPAIR TABLE <table>
SHOW COLUMNS FROM <table>
SHOW CREATE TABLE <table>
SHOW DATABASES [LIKE <pattern>]
SHOW PARTITIONS <table>
SHOW TABLES [IN <schema>] [<pattern>]
SHOW TBLPROPERTIES <table>
USE [<catalog>.]<schema>
VALUES row [, ...]Seehttp://docs.aws.amazon.com/athena/latest/ug/language-reference.htmlExampleathena> use sampledb;
athena:sampledb> show tables;
 tab_name
------------
 elb_logs
(1 rows)

Query deb156b5-293e-472d-8897-5ee195b06b11, SUCCEEDED
https://eu-west-1.console.aws.amazon.com/athena/home?force&region=eu-west-1#query/history/deb156b5-293e-472d-8897-5ee195b06b11
Time: 0:00:00, CPU Time: 474ms total, Data Scanned: 0.00B, Cost: $0.00TroubleshootingUse the--debugoption when launching theathenaCLI to get AWS debug output:$athena--debug2017-07-2110:10:45,477botocore.credentials[DEBUG]Lookingforcredentialsvia:env2017-07-2110:10:45,478botocore.credentials[DEBUG]Lookingforcredentialsvia:assume-role2017-07-2110:10:45,478botocore.credentials[DEBUG]Lookingforcredentialsvia:shared-credentials-file2017-07-2110:10:45,479botocore.credentials[INFO]Foundcredentialsinsharedcredentialsfile:~/.aws/credentials
...Turn on debug at theathena>prompt by typing:athena> set debug true
debug - was: False
now: TrueCommand history is written to~/.athena_history.Similar ProjectsAthenaCLI: CLI tool for AWS Athena service that can do auto-completion and syntax highlighting.athena-cli (Ruby): CLI for Amazon Athena, powered by JRuby.ReferencesAWS Athena:https://aws.amazon.com/athena/AWS SDK for Python:https://boto3.readthedocs.io/en/latest/reference/services/athena.htmlPrestoDB:https://prestodb.io/docs/current/LicenseAthena CLI
Copyright 2017-2018 Guardian News & Media
Copyright 2019,2023 Nick Satterly

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.