2015년 1월 7일 수요일

[phoenix-hbase-user] Existing hbase table mapped as view - field cast as double

I don't know if this is a bug with sqlline, phoenix or unique to my installation
but based on the datatype I get a different answer for the same query.  

I have a table in hbase 

 get 'beta_accounts_created', '20130425020340|000000564259|00000'
COLUMN                               CELL
 d:balance                           timestamp=1420266742812, value=100

I go to phoenix and create the following view
CREATE VIEW "beta_accounts_created" ( 
   pk VARCHAR PRIMARY KEY  
 , "d"."balance"       DOUBLE
);

The query is straight foward

select "d"."balance" from  "beta_accounts_created" where pk = '20130425020340|000000564259|00000';

 -4.3912361131335697E71

then I recreate the view with a different number datatype
CREATE VIEW "beta_accounts_created" ( 
   pk VARCHAR PRIMARY KEY  
 , "d"."balance"       BIGINT
);

select "d"."balance" from  "beta_accounts_created" where pk = '20130425020340|000000564259|00000';

-5678986353556037888

then I recreate the view with as a VARCHAR datatype and then I get the right answer
CREATE VIEW "beta_accounts_created" ( 
   pk VARCHAR PRIMARY KEY  
 , "d"."balance"       VARCHAR
);
 
100

Is this known behavior?
hbase 0.98.6
phoenix 4.2.2
sqlline 1.2.2


댓글 없음:

댓글 쓰기