Skip to main content
Version: Preview

Athena

Experimental
Creates:
AssetsLineage

Configure in the UI

This plugin can be configured directly in the Marmot UI with a step-by-step wizard.

View Guide

The Athena plugin discovers data catalogs, databases, tables, views, workgroups and saved queries from Amazon Athena.

Asset Identity

Athena keeps no catalog of its own: the tables it queries live in the Glue Data Catalog. Databases, tables and views are therefore filed under the Glue provider with the same names the Glue plugin uses, so an Athena run and a Glue run land on one asset instead of two half-populated ones. What Athena knows about such an asset is kept under the athena key of its metadata and in its own Athena entry under Asset Sources.

Workgroups, saved queries and data catalogs are Athena's own objects and are filed under the Athena provider. A saved query is named <workgroup>/<name>, because two workgroups can each hold a query of the same name.

Metadata API

Databases and tables are read through the Athena metadata API, which also serves federated catalogs that Glue knows nothing about. When that API does not answer for a Glue-backed catalog, the plugin reads the Glue Data Catalog directly instead. Set metadata_api to athena or glue to pin the choice.

Lineage

  • A data catalog contains its databases, and a database contains its tables and views.
  • A workgroup contains its saved queries, and every table a saved query reads feeds it.
  • The S3 bucket behind a table's storage location feeds the table, and a workgroup produces the bucket its query results are written to. Bucket assets are not created here: those edges appear once the S3 plugin has catalogued the bucket.

Limitations

Query history is not read, so this plugin produces no usage statistics and no query-derived table-to-table lineage.

Required Permissions

sts:GetCallerIdentity is only needed with tags_to_metadata, because Athena does not return workgroup or catalog ARNs and the plugin builds them from the account id.

AWS Configuration

See AWS Configuration for the supported AWS configuration options.

Example Configuration


credentials:
region: "us-east-1"
profile: "production"
catalogs:
- "AwsDataCatalog"
exclude_databases:
- "default"
include_workgroups: true
include_saved_queries: true
tags:
- "aws"
- "athena"

Configuration

The following configuration options are available:

PropertyTypeRequiredDescription
catalogs[]stringfalseData catalogs to discover. All catalogs when empty
credentialsAWSCredentialsfalseAWS credentials configuration
databases[]stringfalseDatabases to discover. All databases when empty
discover_lineageboolfalseWhether to discover lineage between catalogs, databases, tables, buckets and saved queries
exclude_catalogs[]stringfalseData catalogs to skip
exclude_databases[]stringfalseDatabases to skip
external_links[]ExternalLinkfalseExternal links to show on all assets
filterFilterfalseFilter discovered assets by name (regex)
include_columnsboolfalseWhether to include table columns
include_partitionsboolfalseWhether to include partition keys
include_saved_queriesboolfalseWhether to catalog saved queries
include_tags[]stringfalseList of AWS tags to include as metadata. By default, all tags are included.
include_workgroupsboolfalseWhether to catalog workgroups
metadata_apistringfalseWhich API reads databases and tables: auto, athena or glue
tagsTagsConfigfalseTags to apply to discovered assets
tags_to_metadataboolfalseConvert AWS tags to Marmot metadata
workgroups[]stringfalseWorkgroups to discover. All workgroups when empty

Available Metadata

Table and database metadata is nested under the athena key, because those assets are shared with the Glue plugin.

The following metadata fields are available:

FieldTypeDescription
athena.catalogstringData catalog holding the database or table
athena.catalog_typestringData catalog type (GLUE, HIVE, LAMBDA, FEDERATED)
athena.classificationstringData format of the table (parquet, csv, json, ...)
athena.commentstringTable comment
athena.compressionstringCompression codec of the table data
athena.createdstringDate and time the table was created
athena.databasestringDatabase holding the table
athena.descriptionstringDescription of the database
athena.input_formatstringHadoop input format class
athena.last_accessstringDate and time the table was last accessed
athena.locationstringStorage location of the table data
athena.location_uristringStorage location of the database
athena.output_formatstringHadoop output format class
athena.parametersmap[string]stringDatabase parameters
athena.partition_keysstringPartition key columns
athena.partition_projectionboolWhether partition projection is enabled
athena.serdestringSerialization library
athena.table_typestringTable type (EXTERNAL_TABLE, VIRTUAL_VIEW, ...)
bytes_scanned_cutoffint64Per-query limit on bytes scanned
createdstringDate and time the workgroup was created
databasestringDatabase the saved query runs against by default
descriptionstringDescription of the catalog, workgroup or saved query
encryptionstringEncryption option for query results (SSE_S3, SSE_KMS, CSE_KMS)
encryption_kms_keystringKMS key used to encrypt query results
enforce_configurationboolWhether the workgroup settings override client settings
engine_versionstringEffective Athena engine version
named_query_idstringAthena identifier of the saved query
output_locationstringS3 location query results are written to
parametersmap[string]stringCatalog parameters, such as the Lambda function backing a federated catalog
publish_metricsboolWhether query metrics are published to CloudWatch
regionstringAWS region of the workgroup
requester_paysboolWhether queries may read requester pays buckets
selected_engine_versionstringEngine version the workgroup requested
statestringWorkgroup state (ENABLED, DISABLED)
typestringCatalog type (GLUE, HIVE, LAMBDA, FEDERATED)
urlstringLink to the workgroup in the Athena console
workgroupstringWorkgroup holding the saved query

Table and view columns carry the Hive type verbatim, so a nested type such as array<struct<sku:string>> survives intact.

FieldTypeDescription
column_namestringColumn name
data_typestringHive type of the column, recorded verbatim
descriptionstringColumn comment
is_nullableboolWhether null values are allowed, always true in Athena
is_partition_keyboolWhether the column is a partition key