title: Average of count in hive
body: <p>I have an hive table</p>
  
  <pre><code>id name ....
   1   a
   2   a
   3   a
   4   b
   5   b
   6   b
   7   a
  </code></pre>
  
  <p>Need to find the average of number of occurences of name,</p>
  
  <pre><code>  name  avg
     a    0.57 (4/7)
     b    0.42 (3/7)
  </code></pre>
  
  <p>Please suggest me a query.</p>