sodadata / soda-sql

Soda SQL and Soda Spark have been deprecated and replaced by Soda Core. docs.soda.io/soda-core/overview.html
https://docs.soda.io/
Apache License 2.0
60 stars 17 forks source link

Soda Core | checks.yml for all Tables in Database #356

Open danielbellhv opened 2 years ago

danielbellhv commented 2 years ago

Goal: run checks.yml on all Tables in Database, implicitly / dynamically (not naming 100s of Tables).

Following Soda's quick start, I've completed sections:

Now I'm following Write a check and run a scan - checks.yml.


Problem

However, the documentation only gives examples for checking one Table each.

4 Checks

  1. Sum of Tables (in Database)
  2. Sum of Columns (across all Tables, in Database)
  3. Sum of Tables' descriptions exist
  4. Sum of Columns' descriptions exist

Queries return a COUNT().


So far, checks.yml:

# checks for MY_DATABASE:
  sql_metrics:
  name: num_tables, num_columns
    sum_tables query: |
      SELECT COUNT(*)
      FROM information_schema.tables
      WHERE table_schema = '*';
    sum_columns query: |
      SELECT COUNT(*)
      FROM information_schema.columns
      WHERE table_name = '*';
    sum_tables_descriptions query: |
      -- SQL
    sum_columns_descriptions query: |
      -- SQL
danielbellhv commented 2 years ago

I have both a MySQL and PostgreSQL data sources, with many databases in them

Antoninj commented 2 years ago

Hi @danielbellhv, Soda SQL will soon be deprecated in favor of Soda Core. It seems to me your issue is actually related to Soda Core rather than to Soda SQL. May I ask you to move it to https://github.com/sodadata/soda-core/issues? Thanks!