phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ramkrishna.s.vasudevan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-1008) Problem initiating and using FLOAT ARRAY Type
Date Thu, 29 May 2014 16:29:02 GMT

    [ https://issues.apache.org/jira/browse/PHOENIX-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14012496#comment-14012496
] 

ramkrishna.s.vasudevan commented on PHOENIX-1008:
-------------------------------------------------

[~jamestaylor]
While parsing 
{code}
        String query = "upsert into table_with_array values('" + tenantId
                + "','00A123122312312',ARRAY[2.0,345.8])";
{code}
where the ARRAY represents a float, in the parser code
{code}
ret = factory.literal(new BigDecimal(t.getText()));
{code}
This is giving a BigDecimal object and so the PDataType will be DECIMAL and so everything
is treated as variable array.


> Problem initiating and using FLOAT ARRAY Type
> ---------------------------------------------
>
>                 Key: PHOENIX-1008
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1008
>             Project: Phoenix
>          Issue Type: Bug
>         Environment: Phoenix 3.0 with Hbase 0.94.18
> uname -a: Linux faisal-VirtualBox 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
>            Reporter: Faisal Moeen
>            Priority: Minor
>
> I am unable to use float arrays. I am facing no problem with varchar, integer or double
arrays doing same. I create a table like this:
> {quote}
> create table if not exists location(name varchar not null, point float array[2], box
float array[4], constraint pk primary key (name));
> {quote}
> I add a row to it:
> {quote}
> upsert into LOCATION values('qaisar', array[75.0,75.0], array[72.1,74.1,74.1,72.1]);
> {quote}
> Now I check array lengths:
> {quote}
> select array_length(point),array_length(box) from LOCATION;
> {quote}
> I get the following answer:
> {quote}
> 5,8
> {quote}
> whereas I expect
> {quote}
> 2,4
> {quote}
> The values point[1] or point[2] are also not correct.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message