Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@minotaur.apache.org Received: (qmail 3069 invoked from network); 31 Dec 2009 00:11:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Dec 2009 00:11:53 -0000 Received: (qmail 61521 invoked by uid 500); 31 Dec 2009 00:11:53 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 61475 invoked by uid 500); 31 Dec 2009 00:11:52 -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 61465 invoked by uid 99); 31 Dec 2009 00:11:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Dec 2009 00:11:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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; Thu, 31 Dec 2009 00:11:50 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7FBB2234C045 for ; Wed, 30 Dec 2009 16:11:29 -0800 (PST) Message-ID: <251741338.1262218289518.JavaMail.jira@brutus.apache.org> Date: Thu, 31 Dec 2009 00:11: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 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HBASE-2035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12795501#action_12795501 ] stack commented on HBASE-2035: ------------------------------ Any byte that is > 0x79 does the weird octal 3-byte thingy. Looking at outputing using hbase's Bytes.toStringBinary.... > 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 > Assignee: stack > 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.