Cloud SQL: BigQuery, Redshift, Snowflake
Cloud data warehouses have their own SQL flavors.
BigQuery (Google):
- Uses Standard SQL or Legacy SQL
- UNNEST() for arrays
- Approximate functions (APPROX_COUNT_DISTINCT)
- Nested/repeated fields
Redshift (AWS):
- Based on PostgreSQL
- COPY command for loading
- Distribution styles matter
- No LATERAL joins
Snowflake:
- Very close to ANSI SQL
- FLATTEN() for semi-structured
- QUALIFY clause (filter window functions!)
- Time travel queries
Your core SQL works in all of them!
Check your understanding
Which clause does Snowflake offer for filtering window function results?