You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the only wildcard, %, with the for each check does not include the datasource schema resulting in a query which scans all tables within the information_schema.tables table.
for each table T:
tables:
- raw_stripe.charges # works
- raw_stripe.% # works but queries all tables
- '%'# works but queries all tables checks:
- row_count > 0
Result
Queries [RANDOM] tables not in the schema which results in execution errors
Soda Core 3.0.0b4
Reading configuration file "configuration.yml"
Adding SodaCL dir checks/raw/
Reading SodaCL file "checks/raw/stitch_stripe.yml"
Scan execution starts
Query raw_stripe.for_each_table_T[0]:
SELECT table_name
FROM information_schema.tables
WHERE (lower(table_name) like '%')
Query raw_stripe.[RANDOM_TABLE].aggregation[0]:
SELECT
COUNT(*)
FROM [RANDOM_TABLE].
Query execution error in raw_stripe.[RANDOM_TABLE]..aggregation[0]: 002003 (42S02): SQL compilation error:
Object '[RANDOM_TABLE].' does not exist or not authorized.
[...] -- ALL other tables in`information_schema.tables`
The text was updated successfully, but these errors were encountered:
tombaeyens
changed the title
Check for each with wildcard only leaves out schema querying entire information_schema.tables
For each must filter on schema
Mar 28, 2022
For each must filter only tables for the schema defined in the default data source.
And the docs for the for-each must be reviewed explaining that schema definition goes into the configuration and not in the for each check.
Query postgres.for_each_table_T[0]:
SELECT table_name
FROM information_schema.tables
WHERE (lower(table_name) like 'sodatest_customers_b7580920' OR lower(table_name) like 'sodatest_rawcustomers_54820c8f%' OR lower(table_name) like 'sodatest_rawcustomers_54820c8f%')
AND lower(table_name) not like 'non_existing_table'
AND lower(table_schema) = 'public'
Query postgres.sodatest_customers_b7580920.aggregation[0]:
Using the only wildcard,
%
, with thefor each
check does not include the datasource schema resulting in a query which scans all tables within theinformation_schema.tables
table.QUERY PRODUCE...
SHOULD BE...
Soda Scan
Configuration
Check
Result
Queries
[RANDOM]
tables not in the schema which results in execution errorsThe text was updated successfully, but these errors were encountered: