the table is:
create table test (
id string,
name string,
age string,
modified string)
data like this:
id name age modife
Just slightly different approach than what has been answered in previous answer.
Below example uses hive windowing function to find out the latest record, read more here
SELECT t.id
,t.name
,t.age
,t.modified
FROM (
SELECT id
,name
,age
,modified
,ROW_NUMBER() OVER (
PARTITION BY id ORDER BY unix_timestamp(modified,'yyyy-MM-dd hh:mm:ss') DESC
) AS ROW_NUMBER
FROM test
) t
WHERE t.ROW_NUMBER <= 1;
The modified is string so converting it to timestamp using unix_timestamp(modified,'yyyy-MM-dd hh:mm:ss')
then applying order by on timestamp.