querying-data-lake

Execute Athena SQL queries across federated data lake catalogs with safety checks.

Updated May 12, 2026
One-click install
npx skills add https://github.com/mreferre/aws-agent-toolkit-skills --skill querying-data-lake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: querying-data-lake
Source: https://github.com/mreferre/aws-agent-toolkit-skills/tree/main/.kiro/skills/querying-data-lake
Command: npx skills add https://github.com/mreferre/aws-agent-toolkit-skills --skill querying-data-lake

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you execute Athena SQL queries across your data lake while safely handling workgroups, catalogs, and table discovery so you don’t waste tokens, scan unnecessary data, or hit output-location errors.

Core Features & Use Cases

  • Athena query execution with guardrails: Classifies statements (safe vs potentially destructive), warns on risky scopes (Redshift-federated, cross-catalog joins), and confirms output S3 location before running non-trivial queries.
  • Workgroup-aware querying: Selects a workgroup first, surfaces its output location, and retries only in controlled cases (with user confirmation) when output-location configuration is missing.
  • Target asset resolution & profiling: Resolves fuzzy table references (delegating to finding-data-lake-assets), profiles unfamiliar tables with sample rows, and then builds the final SQL with correct catalog qualification rules.

Quick Start

Ask it to query your data lake with: "Query the orders table with SQL to return the top 10 orders by revenue for the last 30 days."

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 Athena SQL queries safely across different data lake catalogs?

Running Athena SQL safely requires classifying statements to warn on risky scopes, resolving target tables with correct catalog qualification rules for Glue and Redshift, and confirming output S3 locations before executing non-trivial queries.

How does workgroup selection affect Athena SQL query execution?

Workgroup selection in Athena determines the output location for your query results. The execution process surfaces the workgroup's configured output location first and requires confirmation before retrying if output-location configuration is missing.

Can I use Athena to query federated data sources like Redshift?

Yes, Athena supports federated querying across Redshift and S3 Tables. The execution engine applies catalog-specific SQL addressing rules and provides warnings for potentially destructive or risky cross-catalog join scopes.

What is the best way to profile unfamiliar tables before building Athena SQL?

Profiling unfamiliar tables involves resolving fuzzy table references, sampling rows to understand the schema, and then building the final SQL statement with the correct catalog qualification rules applied for the target data lake.

Why does Athena query execution require AWS region and output location confirmation?

AWS region and output S3 location confirmation are required to prevent output-location errors and control costs. This ensures queries scan only necessary data and route results to the correct S3 bucket before execution begins.

Do I need to specify an output S3 location for every Athena SQL query?

Yes, an output S3 location is required for Athena query execution. If the selected workgroup lacks an output location configuration, the system prompts for confirmation before attempting a controlled retry to track output.