You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Cheyenne Forbes <ch...@gmail.com> on 2017/06/06 02:25:46 UTC

Delete from Array

Can I delete elements from Phoenix arrays?

Regards,

Cheyenne O. Forbes

Re: Delete from Array

Posted by Cheyenne Forbes <ch...@gmail.com>.
I know, I was asking if I made a UDF to accept the array and remove the
element the return the new one in a UPSERT if it would work

Regards,
Cheyenne


On Tue, Jun 6, 2017 at 7:32 PM, James Taylor <ja...@apache.org> wrote:

> There's no array_reduce built-in function that I'm aware of, so no.
>
> On Tue, Jun 6, 2017 at 5:27 PM, Cheyenne Forbes <
> cheyenne.osanu.forbes@gmail.com> wrote:
>
>> Can i do
>>
>> *UPSERT(id, myArray) VALUES (1, array_reduce(myArray, "index", 3))*
>> the second argument would be either "index" or "value" (what to delete
>> by) and the last would be the index or value to delete
>>
>> Regards,
>> Cheyenne
>>
>> On Tue, Jun 6, 2017 at 6:17 PM, James Taylor <ja...@apache.org>
>> wrote:
>>
>>> Please feel free to file a JIRA. Though you can delete an element by
>>> using Java code, it'd be nice to have a built-in function to do the same.
>>> Functions like ARRAY_REMOVE_ELEM, ARRAY_SUB_ARRAY would be useful.
>>> Contributions are of course much appreciated.
>>>
>>> Thanks,
>>> James
>>>
>>>
>>> On Tue, Jun 6, 2017 at 3:16 PM, Sergey Soldatov <
>>> sergeysoldatov@gmail.com> wrote:
>>>
>>>> From the Apache Phoenix documentation:
>>>>
>>>>
>>>>    - Partial update of an array is currently not possible. Instead,
>>>>    the array may be manipulated on the client-side and then upserted back in
>>>>    its entirety.
>>>>
>>>> Thanks,
>>>> Sergey
>>>>
>>>> On Mon, Jun 5, 2017 at 7:25 PM, Cheyenne Forbes <
>>>> cheyenne.osanu.forbes@gmail.com> wrote:
>>>>
>>>>> Can I delete elements from Phoenix arrays?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Cheyenne O. Forbes
>>>>>
>>>>
>>>>
>>>
>>
>

Re: Delete from Array

Posted by James Taylor <ja...@apache.org>.
There's no array_reduce built-in function that I'm aware of, so no.

On Tue, Jun 6, 2017 at 5:27 PM, Cheyenne Forbes <
cheyenne.osanu.forbes@gmail.com> wrote:

> Can i do
>
> *UPSERT(id, myArray) VALUES (1, array_reduce(myArray, "index", 3))*
> the second argument would be either "index" or "value" (what to delete by)
> and the last would be the index or value to delete
>
> Regards,
> Cheyenne
>
> On Tue, Jun 6, 2017 at 6:17 PM, James Taylor <ja...@apache.org>
> wrote:
>
>> Please feel free to file a JIRA. Though you can delete an element by
>> using Java code, it'd be nice to have a built-in function to do the same.
>> Functions like ARRAY_REMOVE_ELEM, ARRAY_SUB_ARRAY would be useful.
>> Contributions are of course much appreciated.
>>
>> Thanks,
>> James
>>
>>
>> On Tue, Jun 6, 2017 at 3:16 PM, Sergey Soldatov <sergeysoldatov@gmail.com
>> > wrote:
>>
>>> From the Apache Phoenix documentation:
>>>
>>>
>>>    - Partial update of an array is currently not possible. Instead, the
>>>    array may be manipulated on the client-side and then upserted back in its
>>>    entirety.
>>>
>>> Thanks,
>>> Sergey
>>>
>>> On Mon, Jun 5, 2017 at 7:25 PM, Cheyenne Forbes <
>>> cheyenne.osanu.forbes@gmail.com> wrote:
>>>
>>>> Can I delete elements from Phoenix arrays?
>>>>
>>>> Regards,
>>>>
>>>> Cheyenne O. Forbes
>>>>
>>>
>>>
>>
>

Re: Delete from Array

Posted by Cheyenne Forbes <ch...@gmail.com>.
Can i do

*UPSERT(id, myArray) VALUES (1, array_reduce(myArray, "index", 3))*
the second argument would be either "index" or "value" (what to delete by)
and the last would be the index or value to delete

Regards,
Cheyenne

On Tue, Jun 6, 2017 at 6:17 PM, James Taylor <ja...@apache.org> wrote:

> Please feel free to file a JIRA. Though you can delete an element by using
> Java code, it'd be nice to have a built-in function to do the same.
> Functions like ARRAY_REMOVE_ELEM, ARRAY_SUB_ARRAY would be useful.
> Contributions are of course much appreciated.
>
> Thanks,
> James
>
>
> On Tue, Jun 6, 2017 at 3:16 PM, Sergey Soldatov <se...@gmail.com>
> wrote:
>
>> From the Apache Phoenix documentation:
>>
>>
>>    - Partial update of an array is currently not possible. Instead, the
>>    array may be manipulated on the client-side and then upserted back in its
>>    entirety.
>>
>> Thanks,
>> Sergey
>>
>> On Mon, Jun 5, 2017 at 7:25 PM, Cheyenne Forbes <
>> cheyenne.osanu.forbes@gmail.com> wrote:
>>
>>> Can I delete elements from Phoenix arrays?
>>>
>>> Regards,
>>>
>>> Cheyenne O. Forbes
>>>
>>
>>
>

Re: Delete from Array

Posted by James Taylor <ja...@apache.org>.
Please feel free to file a JIRA. Though you can delete an element by using
Java code, it'd be nice to have a built-in function to do the same.
Functions like ARRAY_REMOVE_ELEM, ARRAY_SUB_ARRAY would be useful.
Contributions are of course much appreciated.

Thanks,
James

On Tue, Jun 6, 2017 at 3:16 PM, Sergey Soldatov <se...@gmail.com>
wrote:

> From the Apache Phoenix documentation:
>
>
>    - Partial update of an array is currently not possible. Instead, the
>    array may be manipulated on the client-side and then upserted back in its
>    entirety.
>
> Thanks,
> Sergey
>
> On Mon, Jun 5, 2017 at 7:25 PM, Cheyenne Forbes <
> cheyenne.osanu.forbes@gmail.com> wrote:
>
>> Can I delete elements from Phoenix arrays?
>>
>> Regards,
>>
>> Cheyenne O. Forbes
>>
>
>

Re: Delete from Array

Posted by Sergey Soldatov <se...@gmail.com>.
From the Apache Phoenix documentation:


   - Partial update of an array is currently not possible. Instead, the
   array may be manipulated on the client-side and then upserted back in its
   entirety.

Thanks,
Sergey

On Mon, Jun 5, 2017 at 7:25 PM, Cheyenne Forbes <
cheyenne.osanu.forbes@gmail.com> wrote:

> Can I delete elements from Phoenix arrays?
>
> Regards,
>
> Cheyenne O. Forbes
>