I have data of the form as below:
hive> desc test;
no string
txdate string
hive>
hive> select * from test;
1 2014-06-01 10:12:12.100
1 2014-06-01 10:12:14.100
1 2014-06-01 10:12:16.100
1 2014-06-01 10:13:12.100
1 2014-06-01 10:14:12.100
I need to group the data using txdate column and truncated to the last minute. Output should be as below
3 2014-06-01 10:12:00
1 2014-06-01 10:13:00
1 2014-06-01 10:14:00
Can anyone help me with the Hive select query to solve this?
We can use substr() function to make this possible.
Query is:
The result of this query will be