Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@minotaur.apache.org Received: (qmail 63863 invoked from network); 28 Dec 2009 23:09:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Dec 2009 23:09:57 -0000 Received: (qmail 71792 invoked by uid 500); 28 Dec 2009 23:09:57 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 71753 invoked by uid 500); 28 Dec 2009 23:09:57 -0000 Mailing-List: contact hbase-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-dev@hadoop.apache.org Delivered-To: mailing list hbase-dev@hadoop.apache.org Received: (qmail 71545 invoked by uid 99); 28 Dec 2009 23:09:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Dec 2009 23:09:56 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Dec 2009 23:09:49 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 825DD234C1EE for ; Mon, 28 Dec 2009 15:09:29 -0800 (PST) Message-ID: <838766577.1262041769532.JavaMail.jira@brutus.apache.org> Date: Mon, 28 Dec 2009 23:09:29 +0000 (UTC) From: "stack (JIRA)" To: hbase-dev@hadoop.apache.org Subject: [jira] Commented: (HBASE-2035) Binary values are formatted wrong in shell In-Reply-To: <1962416095.1260418638273.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-2035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794958#action_12794958 ] stack commented on HBASE-2035: ------------------------------ I've seen this. Its annoying and presents difficultly working binary keys. > Binary values are formatted wrong in shell > ------------------------------------------ > > Key: HBASE-2035 > URL: https://issues.apache.org/jira/browse/HBASE-2035 > Project: Hadoop HBase > Issue Type: Bug > Affects Versions: 0.20.2 > Reporter: Dave Latham > Priority: Minor > Fix For: 0.20.3, 0.21.0 > > > Binary values in the shell don't seem to be formatted correctly. For example: > {code} > hbase(main):007:0> put 't1', 'r1', 'f1:q1', "\x91", 1000 > 0 row(s) in 0.0160 seconds > hbase(main):008:0> scan 't1' > ROW COLUMN+CELL > r1 column=f1:q1, timestamp=1260417826655, value=\357\277\275 > 1 row(s) in 0.1090 seconds > {code} > In this case we insert a single byte (double quotes needed for it to interpret the hex value correctly), but when formatted, it appears as 3 bytes in octal. > The same thing happens when the data is inserted via the Java api. For example, this code: > {code} > HTableDescriptor tableDesc = new HTableDescriptor("t2"); > tableDesc.addFamily(new HColumnDescriptor("f1")); > HBaseAdmin admin = new HBaseAdmin(new HBaseConfiguration()); > admin.createTable(tableDesc); > HTable table = new HTable("t2"); > Put put = new Put(Bytes.toBytes("r1")); > put.add(Bytes.toBytes("f1"), Bytes.toBytes("q1"), new byte[] {(byte) 0x91}); > table.put(put); > Result result = table.get(new Get(Bytes.toBytes("r1"))); > System.out.println(Bytes.toStringBinary(result.raw()[0].getValue())); > {code} > Prints out {{\x91}} > And then accessing via shell gives: > {code} > hbase(main):009:0> scan 't2' > ROW COLUMN+CELL > r1 column=f1:q1, timestamp=1260418531959, value=\357\277\275 > 1 row(s) in 0.1100 seconds > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.