In T418754#11664647, @xcollazo wrote:Indeed the definition of the Superset virtual dataset seems to be double (or triple?) counting:
Dataset definition: https://superset.wikimedia.org/explore/?form_data_key=AdGJRebFr1bvqbReSZziBs8UOCGMWkgC9F7FKNvX__LVy1YQ3bfymfztr-XX08JZ&datasource_type=table&datasource_id=1682
Running the associated query:
with base_directories as ( select id, parent_id, path, files_count, blocks_size, path_depth from wmf.hdfs_usage where type = 'DIRECTORY' and path_depth <= 6 and date(snapshot) >= (current_date - interval '14' day) and case when day_of_week(current_date) = 1 then date(snapshot) < current_date else true end ), base_directories_with_parents as ( select b.id, b.path, b.files_count, b.blocks_size, b.path_depth, p.path as parent_path from base_directories b inner join base_directories p on p.id = b.parent_id ) select path, parent_path, files_count, blocks_size from base_directories_with_parents where ((path = '/tmp' or path = '/var') or (parent_path = '/user') or (parent_path = '/wmf' and path <> '/wmf/data') or (parent_path = '/wmf/data' and path <> '/wmf/data/raw' and path <> '/wmf/data/wmf') or (parent_path = '/wmf/data/raw') or (parent_path = '/wmf/data/wmf')) and (blocks_size >= 10000000000 or files_count > 1000) limit 1000Returns 4 rows of each path:
... /wmf/data/wmf_contributors /wmf/data 20347 140193636567 /wmf/data/wmf_contributors /wmf/data 20347 140193636567 /wmf/data/wmf_contributors /wmf/data 20305 140004135096 /wmf/data/wmf_contributors /wmf/data 20305 140004135096 /wmf/data/wmf_content /wmf/data 2945164 156098555325320 /wmf/data/wmf_content /wmf/data 2945164 156098555325320 /wmf/data/wmf_content /wmf/data 2908070 155424626278535 /wmf/data/wmf_content /wmf/data 2908070 155424626278535 /wmf/data/wme /wmf/data 23878 58067764561 /wmf/data/wme /wmf/data 23878 58067764561 /wmf/data/wme /wmf/data 20711 51681910602 /wmf/data/wme /wmf/data 20711 51681910602 ...And if we multiply 136.3 T * 4 = 136.3 = 545.2 which is close enough to what is being advertised in the dashboard.
In this task we should :
- Investigate why the query quadruple counts, looks related to the snapshot logic?
- Fix and deploy a new version of the dashboard.