You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by tzolkincz <gi...@git.apache.org> on 2014/10/23 13:27:13 UTC

[GitHub] phoenix pull request: PHOENIX-1343 Array insert unique function

GitHub user tzolkincz opened a pull request:

    https://github.com/apache/phoenix/pull/27

    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.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tzolkincz/phoenix array_insert_unique

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/phoenix/pull/27.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #27
    
----
commit 54cf4b5773af942f191b125b2f48e9c72ecd68be
Author: Vaclav Loffelmann <va...@socialbakers.com>
Date:   2014-10-15T16:15:23Z

    PHOENIX-1343 array upsert unique function protype

commit 088969f2ba29013141a7d1f0429f2f8951440aa8
Author: Vaclav Loffelmann <va...@socialbakers.com>
Date:   2014-10-22T18:09:28Z

    update upstream

commit 88072b88d0d3be5c74ddb7e588d210db54dcbf2e
Author: Vaclav Loffelmann <va...@socialbakers.com>
Date:   2014-10-23T10:31:09Z

    merging issues

commit a0d20cb8a1e4caf45f7491aaf0713c07c286a665
Author: Vaclav Loffelmann <va...@socialbakers.com>
Date:   2014-10-23T10:38:47Z

    remove commented code

commit a5850b5f5d79e6d2417c8bfc2353a4bfdcaf7bbb
Author: Vaclav Loffelmann <va...@socialbakers.com>
Date:   2014-10-23T11:21:18Z

    add row locking

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] phoenix issue #27: PHOENIX-1343 Array insert unique function

Posted by sreenu117 <gi...@git.apache.org>.
Github user sreenu117 commented on the issue:

    https://github.com/apache/phoenix/pull/27
  
    Hi,
    I want to upsert data into tables in hbase using phoenix udfs. But I dont find any kind of upsert function to user tables on git. It will be great if you can provide a Udf example for inserting the data to the tables.


---