You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Gabriel Reid (JIRA)" <ji...@apache.org> on 2014/03/16 08:18:57 UTC

[jira] [Resolved] (PHOENIX-409) It's uncorrect to support INTEGER data

     [ https://issues.apache.org/jira/browse/PHOENIX-409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gabriel Reid resolved PHOENIX-409.
----------------------------------

    Resolution: Fixed

Bulk resolve of closed issues imported from GitHub. This status was reached by first re-opening all closed imported issues and then resolving them in bulk.

> It's uncorrect to support INTEGER data
> --------------------------------------
>
>                 Key: PHOENIX-409
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-409
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: szlwin
>
> When I creat the table like:
> CREATE TABLE IF NOT EXISTS USER_INFO ( 
> 	u_id VARCHAR(30) not null  PRIMARY KEY,
> 	u_name VARCHAR(30) not null,
> 	u_atime TIMESTAMP,
> 	u_status INTEGER);
> Then I insert a row and use the cmd at the hbase server like: scan 'USER_INFO',the result is:
>  test0004                        column=_0:U_ATIME, timestamp=1371746185023, value=\x00\x00\x01?`\xB8\xBF\xA02\x11b\x00      
>  test0004                        column=_0:U_NAME, timestamp=1371746185023, value=test11                                     
>  test0004                        column=_0:U_STATUS, timestamp=1371746185023, value=\x80\x00\x00\x03                         
>  test0004                        column=_0:_0, timestamp=1371746185023, value=  
> The value of the 'U_STATUS' is 3,and it's store in the Hbase is '\x80\x00\x00\x03'.
> So I use the clinet API of the Hbase to read this row,the code is:
> 		Configuration conf = HBaseConfiguration.create();
> 		
> 		conf.set("hbase.zookeeper.quorum", "xxx.xxx.xx.xx");
> 		conf.set("zookeeper.znode.parent", "/hbase");
> 		conf.set("hbase.zookeeper.property.clientPort", "2181");
> 		
> 		HTable table = new HTable(conf, "USER_INFO");
> 		Get get = new Get(Bytes.toBytes("test0004"));
> 		
> 		get.addColumn(Bytes.toBytes("_0"), Bytes.toBytes("U_STATUS"));
> 		
> 		Result rs = table.get(get);
> 		
> 		byte[] val = rs.getValue(Bytes.toBytes("_0"),
> 				Bytes.toBytes("U_STATUS"));
> 		System.out.println("Value: " + Bytes.toInt(val));
> This result is: Value: -2147483645
> After when I use the client API of the Hbase to update the 'U_STATUS'(It's value is 3.),and use the cmd of scan:
> test0004                        column=_0:U_ATIME, timestamp=1371746185023, value=\x00\x00\x01?`\xB8\xBF\xA02\x11b\x00      
>  test0004                        column=_0:U_NAME, timestamp=1371746185023, value=test11                                     
>  test0004                        column=_0:U_STATUS, timestamp=1371746185023, value=\x00\x00\x00\x03                         
>  test0004                        column=_0:_0, timestamp=1371746185023, value=  
> The value of the 'U_STATUS' is '\x00\x00\x00\x03',so I can't both use phoenix API and the Hbase API.
> Also when I use the HBase API to insert a row,I can't use the phoenix to delete this row.
> phoenix version:1.0
> Hbase version: 0.94.2



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