Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Phoenix Array datatype issue

Highlighted

Phoenix Array datatype issue

New Contributor

@Timothy Spann

Hi Timothy. I am using Phoenix for my project and I am stuck with Array types. My query is, suppose I have an array column in my table, I am inserting the data in that array, and after some time, weeks, months I will need to update the array, basically append/remove the data to/from it, basically modify the array but I am unable to find the solution for it.

Could you help me with this?

I found this in the Limitations of array on Phoenix.apache.org: -->

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.

Is there any work around for this?

Phoenix array type:

https://phoenix.apache.org/array_type.html

Thanks in advance.

1 REPLY 1

Re: Phoenix Array datatype issue

New Contributor

I would try to eliminate arrays from the design. Maybe remove the array column from the original table and instead have another table with two columns: one references the row of the old table, one contains the array members (one member per row.) This way you can leverage atomicity guarantees which you miss when trying to manipulate arrays.

Don't have an account?
Coming from Hortonworks? Activate your account here