agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/databases/snowflake/SKILL.md

snowflake

Skill15 starsChanged 42 days agoMITView on GitHub

Expert Snowflake cloud data warehouse assistance covering Virtual Warehouses, Snowpipe, zero-copy cloning, time travel, and Streamlit. Use when building enterprise analytical data warehouses or running big data analytics.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use metadata-only Zero-Copy Cloning with Time Travel:

    line 75
  2. Distinctive:

    Use Dynamic Data Masking: Protect sensitive PII columns using role-based masking policies.

    line 93
  3. Distinctive:

    Leave oversized virtual warehouses running 24/7: Size warehouses appropriately.

    line 97
  4. Distinctive:

    Use Snowflake for single-row transactional OLTP: High latency per single insert makes Snowflake unsuitable for low-latency operational …

    line 98

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Snowflake

Snowflake is a cloud-native data warehouse. It separates compute ("Virtual Warehouses") from storage, allowing them to scale independently.

When to Use

  • Cloud Data Warehousing & Data Lakes: Consolidating enterprise data across AWS, Azure, and GCP into a single analytical platform.
  • Separation of Compute and Storage (Virtual Warehouses): Scaling compute clusters up, down, or suspending instantly without copying data.
  • Zero-Copy Data Cloning & Time Travel: Cloning multi-terabyte production databases in seconds for dev/test without storage cost duplication.
  • Secure Cross-Company Data Sharing: Sharing live, governed datasets with external partners without ETL replication.

Quick Start

-- Create warehouse (Compute)
CREATE WAREHOUSE my_wh WITH WAREHOUSE_SIZE = 'X-SMALL';

-- Query JSON directly (Variant type)
SELECT src:sales.order_id::integer
FROM raw_data;

Core Concepts

Multi-Cluster Shared Data Architecture

Decouples centralized cloud storage from independent, autoscaling virtual compute warehouses:

[ Central Cloud Storage (AWS S3 / Azure Blob / GCS) ]
         ├── [ Virtual Warehouse: ETL (Size: X-Large) ]
         ├── [ Virtual Warehouse: BI Reports (Size: Medium, Autoscale) ]
         └── [ Virtual Warehouse: Data Science (Size: Large) ]

Time Travel & Zero-Copy Cloning

Restores historical data and creates instant instant clones without data duplication:

-- Query data as it existed 2 hours ago
SELECT * FROM analytics.orders
AT(OFFSET => -60*120)
WHERE status = 'FAILED';

-- Instant zero-copy clone for testing (takes 2 seconds, zero storage added)
CREATE OR REPLACE DATABASE dev_clone_2026 CLONE production;

Native Semi-Structured VARIANT Querying

Ingests and queries nested JSON, Avro, and Parquet data directly:

SELECT
  raw_payload:user_id::string AS user_id,
  raw_payload:event_name::string AS event_name,
  raw_payload:metadata.device.os::string AS os_system
FROM raw_logs.event_stream
WHERE raw_payload:event_name = 'checkout_completed';

Common Patterns

Zero-Copy Cloning with Time Travel Recovery

Problem: Creating staging replicas of terabyte datasets for testing consumes massive storage and time.

Solution: Use metadata-only Zero-Copy Cloning with Time Travel:

-- Instantly clone production database without duplicating underlying micro-partitions
CREATE OR REPLACE DATABASE dev_db CLONE prod_db;

-- Recover accidentally dropped or updated table state from 2 hours ago
CREATE OR REPLACE TABLE orders_restored CLONE prod_db.public.orders
  AT (OFFSET => -60*120);

Best Practices

Do:

  • Enable Auto-Suspend and Auto-Resume: Set warehouses to auto-suspend after 60 seconds of inactivity (AUTO_SUSPEND = 60) to stop billing.
  • Cluster by Primary Query Dimensions: Apply cluster keys (CLUSTER BY (event_date, customer_id)) on multi-terabyte tables to optimize micro-partition pruning.
  • Leverage Transient Tables for Staging: Use CREATE TRANSIENT TABLE for intermediate ETL steps to eliminate Time Travel storage costs.
  • Use Dynamic Data Masking: Protect sensitive PII columns using role-based masking policies.

Don't:

  • Leave oversized virtual warehouses running 24/7: Size warehouses appropriately; scale down when batch jobs complete.
  • Use Snowflake for single-row transactional OLTP: High latency per single insert makes Snowflake unsuitable for low-latency operational backends.
  • Ignore micro-partition pruning: Always filter queries by date or clustered keys to avoid full table scans.

Troubleshooting

ErrorCauseSolution
Warehouse '...' has exceeded maximum credit limitLong-running queries keeping large virtual warehouse active.Configure AUTO_SUSPEND = 60 and AUTO_RESUME = TRUE on warehouses.
Query compilation error: ambiguous column nameJoins referencing shared column names without table aliases.Qualify all column references with explicit table aliases.
Snowpipe load error: File size exceeds maximumStaged file too large for streaming ingestion.Split input files into optimal 100MB-250MB compressed chunks.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.