From aws-data-analytics
Executes and manages Athena SQL queries across Glue, S3 Tables, and Redshift catalogs with workgroup selection, asset resolution, statement classification, error recovery, and cost reporting.
npx claudepluginhub aws/agent-toolkit-for-aws --plugin aws-data-analytics[SQL-query|query-name|workgroup-name|catalog-name|'profile TABLE_NAME']This skill uses the workspace's default tool permissions.
Execute SQL queries on Amazon Athena across default and federated catalogs (Glue, S3 Tables, Redshift) with workgroup selection, statement classification, and error recovery.
Inventories and audits AWS Glue Data Catalog assets across S3 tables, Redshift-federated, and remote Iceberg catalogs. For listing catalogs, databases, tables and data landscape overviews.
Analyzes Fabric lakehouse data interactively via Livy API sessions using PySpark and Spark SQL for advanced analytics, DataFrames, cross-joins, Delta time-travel, and JSON data.
Automates Snowflake data warehouse operations: lists databases/schemas/tables with filters, executes SQL (SELECT/DDL/DML), manages workflows via Composio MCP.
Share bugs, ideas, or general feedback.
Execute SQL queries on Amazon Athena across default and federated catalogs (Glue, S3 Tables, Redshift) with workgroup selection, statement classification, and error recovery.
Executes and manages Athena SQL queries across default and federated catalogs. Selects a workgroup, resolves target assets (delegating fuzzy references to finding-data-lake-assets), classifies statements for safety, and reports cost and data scanned. Use the AWS MCP server for sandboxed execution and audit logging; the same AWS CLI commands work directly when the MCP server is not available.
Constraints for parameter acquisition:
profile TABLE_NAMECheck for required tools and AWS access before running queries.
Constraints:
aws___call_aws) and run queries through them when present; fall back to AWS CLI only if the MCP server is unavailableaws athena CLI so output location and cost are trackedaws sts get-caller-identity and inform the user about any missing toolsCheck caller identity, list workgroups, auto-select the best one (see workgroup-selection.md).
Constraints:
If the user refers to a table by name, by business concept ("our quarterly report", "the sales data"), by S3 path, or by catalog without specifying the table, delegate to finding-data-lake-assets to return the concrete database.table (and catalog if non-default).
Constraints:
athena list-data-catalogs or by iterating get-tables — those miss federated catalogs and waste tokensdatabase.table) or raw SQL they want executed as-isfinding-data-lake-assets returns a different catalogFor analytical queries, You SHOULD profile the target table before building the final query. You MUST show sample rows (SELECT ... LIMIT 5) as part of profiling.
Table addressing depends on catalog type:
database.table (omit the catalog prefix for single-catalog queries). In cross-catalog queries, qualify default-catalog tables with "awsdatacatalog".database.table.datasource.database.table"catalog/subcatalog".database.tableClassify the SQL statement before executing:
| Statement | Behavior |
|---|---|
SELECT, SHOW, DESCRIBE, EXPLAIN | Safe — execute |
INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, TRUNCATE, MERGE | Destructive — warn the user and require explicit confirmation |
| Unsure | Treat as destructive; confirm |
Example tool call (via AWS MCP server):
aws___call_aws(command="aws athena start-query-execution --work-group <WORKGROUP_NAME> --query-string '<sql>' --query-execution-context Database=<db>")
For federated or S3 Tables catalogs, also set Catalog=<CATALOG_PATH> in the execution context (e.g. Catalog=s3tablescatalog/<BUCKET_NAME>).
Constraints:
Present results with cost, data scanned, duration, and actionable insights. On failure, list available workgroups and let the user choose which to retry with.
Resolve in this order; stop at the first match:
SELECT, SHOW, DESCRIBE, INSERT, etc.) — SQL text, execute directlyprofile TABLE_NAME — run comprehensive table profiling (see query-patterns.md)exploring-data-catalog to enumerate databases and tablesLIMIT for exploratory queries on large tables| Error | Cause | Fix |
|---|---|---|
| Redshift identifier error with mixed case | Redshift-federated names are lowercase only | Lowercase the identifier |
CatalogId validation failure | ARN passed instead of catalog name | Pass the catalog name, not the ARN |
Cross-catalog information_schema returns nothing | Missing catalog qualifier | Use catalog-qualified path: "catalog".information_schema.tables |
| Query fails with output-location error | Workgroup has no output location configured | Select a different workgroup with an output location, or configure one |
| Destructive statement executed without confirmation | Statement classification skipped | Always classify INSERT/UPDATE/DELETE/DROP/ALTER/CREATE/TRUNCATE/MERGE and confirm with the user |