How to fetch latest datapoint for a unique pair of columns

My data source looks like this

How am I to fetch the latest datapoint with timestamp for a unique combination of (asset-id, gateway-id, tenant-id)?
For instance, query(asset-id,gateway-id,tenant-id) should return
2019-01-29T05:55:04.954Z │ 1DA23A0647524D2F8A65FC62A9ACB775 │ boolean │ 5CE73EA9D95F427A8C110C3D65F3A0EB │ │ java.util.LinkedHashMap │ 6C8257E53D5E41F38EDC49EE822AA52E │ false

How am I to achieve this?