querying-data-lake

Execute and manage Athena SQL queries across Glue, S3 Tables, and Redshift catalogs.

Updated Jul 1, 2026
One-click install
npx skills add https://github.com/sakicodes/BuildFestHackathon26 --skill querying-data-lake-sakicodes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: querying-data-lake
Source: https://github.com/sakicodes/BuildFestHackathon26/tree/main/.agents/skills/querying-data-lake
Command: npx skills add https://github.com/sakicodes/BuildFestHackathon26 --skill querying-data-lake-sakicodes

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Running SQL against a data lake involves picking the right Athena workgroup, resolving fuzzy table references across federated catalogs, and avoiding costly or destructive queries. This Skill handles that entire workflow so queries execute safely with cost and scan visibility. ## Core Features & Use Cases - Workgroup-aware execution: Detects the IAM context (including SageMaker project roles), selects the correct Athena workgroup, and confirms the output S3 location before running anything. - Statement classification and safety: Classifies SQL as safe (SELECT/SHOW/DESCRIBE) or destructive (INSERT/DELETE/DROP/etc.) and requires explicit confirmation before destructive statements. - Federated catalog support: Queries default Glue catalogs, S3 Tables, and Redshift-federated sources with correct catalog-qualified addressing, plus table profiling with reusable Presto/Athena query patterns. - Use Case: Ask to "profile the sales table" and the Skill resolves the table, samples rows, runs null and cardinality analysis, and reports data scanned and cost. ## Quick Start Ask the assistant to run a SQL query or profile a table in Athena, for example: profile the orders table in my data lake.

Frequently Asked Questions about querying-data-lake

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a SQL query on Amazon Athena across multiple catalogs?

Provide the SQL text or a table name and the Skill selects a workgroup, resolves the catalog (Glue, S3 Tables, or Redshift), and executes via the AWS MCP server or aws athena CLI. Federated catalogs are addressed with catalog-qualified paths like datasource.database.table.

How do I profile a table in Athena before analysis?

Pass 'profile TABLE_NAME' as the argument. The Skill samples rows with SELECT LIMIT 5, checks schema via information_schema, and runs null-count and distinct-value analysis using the patterns in references/query-patterns.md.

Does Athena querying work with SageMaker Unified Studio project roles?

Yes. The Skill detects AmazonDataZone or SageMakerUnifiedStudio assumed-role ARNs, extracts the project ID, and matches the corresponding sagemaker-studio-workgroup. It will not fall back to the primary workgroup, which would fail with AccessDeniedException.

Why does my Athena query fail with an output location error?

The selected workgroup has no S3 output location configured. The Skill prevents this by listing workgroups first and choosing one with a configured output location, or prompting you to pick another on failure.

What happens if my SQL contains DELETE or DROP statements?

Destructive statements (INSERT, UPDATE, DELETE, DROP, ALTER, CREATE, TRUNCATE, MERGE) are classified before execution and require your explicit confirmation. Unclassifiable statements are treated as destructive by default.

When should I not use this Skill for data lake tasks?

Do not use it to find specific data assets (use finding-data-lake-assets), run full catalog audits (use exploring-data-catalog), or import data (use ingesting-into-data-lake). It is scoped to executing and managing SQL queries.