apache/incubator-phoenix — pull request #30 by tzolkincz (2014-04-17 13:46:22+00:00)
Title: Add functions FIRST_BY and LAST_BY

I've created aggregation functions like oracles FIRST_VALUE (http://www.oracle-base.com/articles/misc/first-value-and-last-value-analytic-functions.php). Null values will be skipped. Syntax is FIRST_BY(value, over[, offset]). Example of usage: you wanna get first value by date.
```
SELECT FIRST_BY(value, date) FROM table GROUP BY something
```
if you specify offset value, you'll get second youngest value. Query will looks like
```
SELECT LAST_BY(value, date, 2) FROM table GROUP BY something
```

Thanks for merge.