snowflake-data-engineering
Installation
SKILL.md
Snowflake Data Engineering
This skill covers SQL conventions, pipeline architecture (Dynamic Tables, Streams, Tasks, Snowpipe), performance tuning, and cost/access management on Snowflake.
Workflow for Building a Snowflake Pipeline
- Land raw data — Use Snowpipe (
AUTO_INGEST = TRUE) for continuous file loads from an external stage, or Snowpipe Streaming for low-latency row-level ingestion via SDK. - Choose a transformation approach — Prefer Dynamic Tables for declarative, most pipelines; fall back to Streams + Tasks only when you need procedural logic or stored-procedure calls.
- Model semi-structured data — Land raw JSON/Avro/Parquet as
VARIANT, then flatten into typed relational columns as early as practical. - Chain pipeline stages — Build Dynamic Tables on top of each other (or Streams feeding Tasks) so each stage narrows scope from raw to cleaned to aggregated.
- Tune for performance — Add clustering keys or Search Optimization only where query patterns justify them; tag queries for cost attribution.
- Set access controls — Apply least-privilege RBAC with functional roles (loader, transformer, analyst) and masking/row-access policies for sensitive data.
- Monitor cost and freshness — Track
WAREHOUSE_METERING_HISTORYandQUERY_HISTORY, set Resource Monitors, and validateTARGET_LAGmatches actual freshness requirements.
SQL and Semi-Structured Data
- Use
VARIANT,OBJECT, andARRAYtypes for JSON, Avro, Parquet, and ORC data. - Access nested fields with colon notation and cast explicitly:
src:customer.name::STRING,src:price::NUMBER(10,2),src:created_at::TIMESTAMP_NTZ. - Flatten arrays with
LATERAL FLATTEN: