If I were you, I would try using the MAX() window function for the size attribute.
SELECT state ,COUNT(DISTINCT(file)) ,MAX(size) OVER(PARTITION BY state, file) AS size FROM mytable GROUP BY state