title: HIVE - group by date function
body: <p>Can anyone tell me why I'm not getting counts for each f0, MONTH, DAY, HOUR, MINUTE group in my result set?</p>
  
  <p>Result set:</p>
  
  <p><img src="https://i.stack.imgur.com/UrW7K.png" alt="result set"></p>
  
  <p>Query:</p>
  
  <pre><code>SELECT t.f0, MONTH(TO_DATE(Hex2Dec(t.f2))), DAY(TO_DATE(Hex2Dec(t.f2))), HOUR(TO_DATE(Hex2Dec(t.f2))), MINUTE(TO_DATE(Hex2Dec(t.f2))), COUNT(DISTINCT t.f1)  
  FROM table t  
  WHERE (t.f0 = 1 OR t.f0 = 2)  
  AND (t.f3 &gt;= '2013-02-06' AND t.f3 &lt; '2013-02-15')   
  AND (Hex2Dec(t.f2) &gt;= 1360195200 AND Hex2Dec(t.f2) &lt; 1360800000)  
  AND *EXTRA CONDITIONS*  
  GROUP BY t.f0, MONTH(TO_DATE(Hex2Dec(t.f2))), DAY(TO_DATE(Hex2Dec(t.f2))),   HOUR(TO_DATE(Hex2Dec(t.f2))), MINUTE(TO_DATE(Hex2Dec(t.f2)))  
  </code></pre>
  
  <p>Schema: </p>
  
  <p>f0    INT (Partition Column)<br>
  f1    INT<br>
  f2    STRING<br>
  f3    STRING (Partition Column)<br>
  f4    STRING<br>
  f5    STRING<br>
  f6    STRING<br>
  f7    MAP<code>&lt;STRING,STRING&gt;</code>  </p>
  
  <p>*f2 is a unix timestamp in Hexadecimal format</p>