I tried this
create table TABLE_WITH_ARRAY (organization_id char(15) not null,entity_id
char(15) not null,a_double_array double array[] CONSTRAINT pk PRIMARY KEY
(organization_id, entity_id));
upsert into table_with_array values('" +
tenantId"','00A123122312312',ARRAY[2.0d,345.8d])"
The below select queries worked fine too.
query = "SELECT ARRAY_ELEM(a_double_array,2) FROM table_with_array";
query = "select array_length(a_double_array) from table_with_array";
Are you facing the problem with only Floats ?
Regards
Ram
From: faisal moeen [mailto:[email protected]]
Sent: Wednesday, May 28, 2014 10:04 PM
To: [email protected]
Subject: Problem with Phoenix Float Array Type?
Hi,
I am using Phoenix 3.0 with Hbase 0.94.18.
I am unable to use float arrays. I am facing no problem with varchar arrays
doing same.
I create a table like this:
create table if not exists location(name varchar not null, point float
array[2], box float array[4], constraint pk primary key (name));
I add a row to it:
upsert into LOCATION values('qaisar', array[75.0,75.0],
array[72.1,74.1,74.1,72.1]);
Now I check array lengths:
select array_length(point),array_length(box) from LOCATION;
I get the following answer:
5,8
whereas I expect
2,4
The values point[1] or point[2] are also not correct.
Am I doing something wrong?
An I upserting the data correctly?
Also if I user literal 75 instead of 75.0, it throws an exception.
Thanks.
--
Regards
Faisal Moeen