apache/phoenix — pull request #27 by tzolkincz (2014-10-23 11:27:10+00:00)
Title: PHOENIX-1343 Array insert unique function

Hi,
I've created ARRAY_INSERT_UNIQUE function for add elements to array which are unique. Code is executed at region coprocessor hence there is no network roundtrip and consistency. In fact consistency is enforced by row lock.
Example query:
```
UPSERT INTO ARRAY_UPSERT_UNIQUE_TABLE (k1, arr) VALUES (1, ARRAY_INSERT_UNIQUE(ARRAY[1, 2, 5]))
```
Function accepts any array data type, but can't modify array at the end of row key.
I've implemented some logic for run coprocessors for data modificatioin. I'd be glad to hear some feedback.

How it works:
There is UpsertFunctionExpression expression that defines interface for other server side upsert functions. Any of child function implements getAttributes method. These attributes (plus info about cf and qualifier, sort order and data type) are attached to put as attributes.