Hey Adam, Sounds like you want something like select max(struct(timestamp, value)) group by hash;
This feature is really new - see HIVE-1128 and HIVE-1130 -Todd On Thu, Feb 4, 2010 at 5:04 PM, Adam J. O'Donnell <[email protected]> wrote: > Guys: > > I have a series of queries that looks for the most recent value associated > with a given key. For example, consider the following query: > > select max(timestamp), hash, most_recent(value) group by hash. > > Right now I do this by a hack: I grab max(timestamp * 100 + value), then I > grab the value off the end of the computed maximum. > > Is there a smarter way of doing this? It seems like it would be a relatively > common query. > > -- > Adam J. O'Donnell, Ph.D. > Immunet Corporation > Cell: +1 (267) 251-0070 > >
