Hello, You seem to have asked this in the HDFS forum, not a Hive forum.
This sounds like a normal SQL question. I have to assume you have a field which would be “match”, you order by that field, and limit the results to the first. A google search would almost certainly come up with a better tutorial than I could write.
Goodluck