Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for each doesn't support schema.table_name #1162

Closed
jasonicarter opened this issue Mar 23, 2022 · 1 comment
Closed

Check for each doesn't support schema.table_name #1162

jasonicarter opened this issue Mar 23, 2022 · 1 comment

Comments

@jasonicarter
Copy link

The for each table T: check works for <table_name> but not <schema.table_name> unlike, and as expected, the checks for check which supports <schema.table_name>

Example Checks.yml

# Not working...
for each table T:
  tables:
    - android.application_installed
  checks:
    - row_count > 0

# Working...
checks for android.application_installed:
  - row_count > 0

Result - for each table T:

$ soda scan -d raw -c configuration.yml -V checks/checks.yml
Soda Core 3.0.0b4
Reading configuration file "configuration.yml"
Reading SodaCL file "checks/checks.yml"
Cross data source table sets not yet supported. android.application_installed refers to non default data source  android. Default data source is raw
Scan execution starts
Query raw.for_each_table_T[0]:
SELECT table_name 
FROM information_schema.tables
Query raw.APPLICATION_INSTALLED.aggregation[0]:

Result - checks for:

$ soda scan -d raw -c configuration.yml -V checks/checks.yml
Soda Core 3.0.0b4
Reading configuration file "configuration.yml"
Reading SodaCL file "checks/checks.yml"
Scan execution starts
Query raw.android.application_installed.aggregation[0]:
SELECT 
  COUNT(*) 
FROM android.application_installed
@tombaeyens
Copy link
Contributor

tombaeyens commented Mar 28, 2022

Thanks for the feedback, @jsonicarter !

The schema is specified in the definition of the data source. So no need to do that in the checks.yml. The goal is for a scan to run only the check files for a single data source (apart from the cross data source row-count checks).

Please reopen and add more context if you think different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants