You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Mariana Medeiros <63...@gmail.com> on 2016/05/06 10:52:39 UTC
Phoenix - HBase: complex data
Hello :)
I have a Java class Example with a String and an ArrayList<Person> fields.
I am using Apache phoenix to insert and read data from HBase.
For the String field, I do something like this: *create table tableName
(name varchar(32))* /////// *upset into tableName values ('"+
example.getName() +"')"*
But I do not know how to do such thing for the ArrayList field.
Thank you in advance.
Re: Phoenix - HBase: complex data
Posted by Mariana Medeiros <63...@gmail.com>.
Hello Josh,
Thank you for the reply. I read that page but it only consider primitive
types: "Any primitive type may be used in an ARRAY."
What if I want to create an array of a complex type (in this case, an array
of Person objects)?
Thank you.
- Mariana
2016-05-06 18:29 GMT+01:00 Josh Elser <jo...@gmail.com>:
> Hi Mariana,
>
> You could try defining an array of whatever type you need.
>
> See https://phoenix.apache.org/array_type.html for more details.
>
> - Josh
>
> Mariana Medeiros wrote:
>
>> Hello :)
>>
>> I have a Java class Example with a String and an ArrayList<Person> fields.
>> I am using Apache phoenix to insert and read data from HBase.
>> For the String field, I do something like this: *create table tableName
>> (name varchar(32))* /////// *upset into tableName values ('"+
>> example.getName() +"')"*
>> *
>> *
>> *
>> *
>> But I do not know how to do such thing for the ArrayList field.
>>
>>
>> Thank you in advance.
>>
>
Re: Phoenix - HBase: complex data
Posted by Josh Elser <jo...@gmail.com>.
Hi Mariana,
You could try defining an array of whatever type you need.
See https://phoenix.apache.org/array_type.html for more details.
- Josh
Mariana Medeiros wrote:
> Hello :)
>
> I have a Java class Example with a String and an ArrayList<Person> fields.
> I am using Apache phoenix to insert and read data from HBase.
> For the String field, I do something like this: *create table tableName
> (name varchar(32))* /////// *upset into tableName values ('"+
> example.getName() +"')"*
> *
> *
> *
> *
> But I do not know how to do such thing for the ArrayList field.
>
>
> Thank you in advance.