<commit_before>CREATE OR REPLACE VIEW research_item_min_max_year AS
SELECT
       1 as id,
       v.research_entity as research_entity,
       rit.type as item_type,
       rit.key as item_key,
       count(p) as count,
       MIN(p.start_date) AS min,
       MAX(p.start_date) AS max
FROM verify v
       JOIN project p on v.research_item = p.id
       JOIN research_item_type rit ON p.type = rit.id
GROUP BY research_entity, item_key, item_type

UNION ALL

SELECT
       1 as id,
       v.research_entity as research_entity,
       rit.type as item_type,
       'all' as item_key,
       count(p) as count,
       MIN(p.start_date) AS min,
       MAX(p.start_date) AS max
FROM verify v
       JOIN project p on v.research_item = p.id
       JOIN research_item_type rit ON p.type = rit.id
GROUP BY research_entity, item_type, item_key

UNION ALL

SELECT
        1 as id,
       v.research_entity as research_entity,
       rit.type as item_type,
       rit.key as item_key,
       count(a) as count,
       MIN(a.year) AS min,
       MAX(a.year) AS max
FROM verify v
       JOIN accomplishment a on v.research_item = a.id
       JOIN research_item_type rit ON a.type = rit.id
GROUP BY research_entity, item_key, item_type

UNION ALL

SELECT
        1 as id,<commit_msg>Update db view min max years: use year instead of date<commit_after>CREATE OR REPLACE VIEW research_item_min_max_year AS
SELECT
       1 as id,
       v.research_entity as research_entity,
       rit.type as item_type,
       rit.key as item_key,
       count(p) as count,
       MIN(p.start_year) AS min,
       MAX(p.start_year) AS max
FROM verify v
       JOIN project p on v.research_item = p.id
       JOIN research_item_type rit ON p.type = rit.id
GROUP BY research_entity, item_key, item_type

UNION ALL

SELECT
       1 as id,
       v.research_entity as research_entity,
       rit.type as item_type,
       'all' as item_key,
       count(p) as count,
       MIN(p.start_year) AS min,
       MAX(p.start_year) AS max
FROM verify v
       JOIN project p on v.research_item = p.id
       JOIN research_item_type rit ON p.type = rit.id
GROUP BY research_entity, item_type, item_key

UNION ALL

SELECT
       1 as id,
       v.research_entity as research_entity,
       rit.type as item_type,
       rit.key as item_key,
       count(a) as count,
       MIN(a.year) AS min,
       MAX(a.year) AS max
FROM verify v
       JOIN accomplishment a on v.research_item = a.id
       JOIN research_item_type rit ON a.type = rit.id
GROUP BY research_entity, item_key, item_type

UNION ALL

SELECT
       1 as id,
{'fraction_non_alphanumeric': 0.06242729740209384, 'fraction_numerical': 0.0031019775106630476, 'mean_word_length': 2.381389252948886, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1784956', 'n_tokens_mistral': 876, 'n_tokens_neox': 861, 'n_words': 293}