Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

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

Explorer

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.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.