phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Taylor <jamestay...@apache.org>
Subject Re: Problem with Phoenix Float Array Type?
Date Wed, 28 May 2014 21:16:43 GMT
Faisal,
Thanks for reporting these issues with float arrays. These are definitely
bugs. Please file JIRAs on them here:
https://issues.apache.org/jira/browse/PHOENIX
Regards,
James


On Wed, May 28, 2014 at 11:25 AM, faisal moeen <fmorakzai@gmail.com> wrote:

> Yes. integer arrays and double arrays are working fine.
>
> Do I need to use some postfix with the literal values to specify that they
> are float?
>
> In your example you used 'd' with the constants '2.0d'.
>
> Regards
> Faisal Moeen
>
>
> On Wed, May 28, 2014 at 8:05 PM, Vasudevan, Ramkrishna S <
> ramkrishna.s.vasudevan@intel.com> wrote:
>
>>  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:fmorakzai@gmail.com]
>> *Sent:* Wednesday, May 28, 2014 10:04 PM
>> *To:* user@phoenix.incubator.apache.org
>> *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
>>
>
>
>
> --
>
> Regards
> Faisal Moeen
>

Mime
View raw message