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

inconsistent metadata_type among products #12

Open
benjimin opened this issue Aug 4, 2017 · 0 comments
Open

inconsistent metadata_type among products #12

benjimin opened this issue Aug 4, 2017 · 0 comments

Comments

@benjimin
Copy link
Contributor

benjimin commented Aug 4, 2017

Should audit product definitions for consistency in metadata_type, and datasets for consistency with products.

Currently in prod db,

SELECT count(*), array_agg(distinct m.name) as dataset_metadata, pm.name as product_metadata, p.name as product
FROM agdc.dataset d 
JOIN agdc.metadata_type m on d.metadata_type_ref = m.id 
JOIN agdc.dataset_type p on p.id = d.dataset_type_ref 
JOIN agdc.metadata_type pm on pm.id = p.metadata_type_ref 
GROUP BY p.name, pm.name order by p.name;

 count  |  dataset_metadata  | product_metadata |           product            
--------+--------------------+------------------+------------------------------
 227432 | {landsat_scene}    | landsat_l1_scene | ls5_level1_scene
 128797 | {landsat_scene}    | landsat_scene    | ls5_nbar_scene
    328 | {landsat_l1_scene} | landsat_l1_scene | ls8_level1_oli_scene
  59353 | {landsat_l1_scene} | landsat_l1_scene | ls8_level1_scene
    108 | {eo}               | eo               | ls8_nbar_oli_scene
  47867 | {landsat_scene}    | landsat_scene    | ls8_nbar_scene

Requires updates to product definition yamls (multiple repos?) plus database fixes. e.g.

update agdc.dataset d set metadata_type_ref = p.metadata_type_ref from agdc.dataset_type p where p.id = d.dataset_type_ref ;
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

1 participant