Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BA237187B7 for ; Tue, 9 Jun 2015 04:23:54 +0000 (UTC) Received: (qmail 7335 invoked by uid 500); 9 Jun 2015 04:23:51 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 6884 invoked by uid 500); 9 Jun 2015 04:23:51 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 6872 invoked by uid 99); 9 Jun 2015 04:23:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jun 2015 04:23:51 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yuzhihong@gmail.com designates 209.85.160.169 as permitted sender) Received: from [209.85.160.169] (HELO mail-yk0-f169.google.com) (209.85.160.169) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jun 2015 04:21:36 +0000 Received: by yken206 with SMTP id n206so3223326yke.2 for ; Mon, 08 Jun 2015 21:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=P9xACLCMkypDb/2Z4osgMhKRSMiZ15YI/mSn846BNP8=; b=C417CmXFMc1m7sPNrywDEt8vfYWnz8oIQZ0Eo/v/0wXkONoHsSJT4p72tKpCat10+h YhK0k5n2jP4IVupLsEHJEjV0WrAIBhVNZ5pteFqoZPPh3GPt/lhLw0uSEPUzOzNQvTNl 6zsD9N5MX0BVOBHOuuD76hWF8eCTy0caCn5zfA9obAGgwB5SmtzOTLXI9lbH9od835y9 EoWPJFpmDnM64mPiBPuaKUYA7iU9FFzvhz5jzFYuR4ev1LSnpqCPCHEx6h7eNXWvk4gS p93oa3xl5MpS7bEb34XuHOPh6HO2kEQsaDiukiICOUCKcXxIiJ4nJujg3gKfEocLDXkT CC7Q== MIME-Version: 1.0 X-Received: by 10.170.212.3 with SMTP id d3mr22716011ykf.69.1433823804425; Mon, 08 Jun 2015 21:23:24 -0700 (PDT) Received: by 10.37.223.73 with HTTP; Mon, 8 Jun 2015 21:23:24 -0700 (PDT) In-Reply-To: References: Date: Mon, 8 Jun 2015 21:23:24 -0700 Message-ID: Subject: Re: HBase shell providing wrong results with startrow(with composite key having String and Ints) From: Ted Yu To: "user@hbase.apache.org" Content-Type: multipart/alternative; boundary=001a1139f386888a1805180e1efa X-Virus-Checked: Checked by ClamAV on apache.org --001a1139f386888a1805180e1efa Content-Type: text/plain; charset=UTF-8 Double quotes allow you to do string interpolation. Aother difference (one pertinent to Anil's question) is that 'escape sequence' does not work using single quote. Cheers On Mon, Jun 8, 2015 at 9:11 PM, anil gupta wrote: > Hi Jean, > > My bad. I gave a wrong illustration. This is the query is was trying on my > composite key: > hbase(main):017:0> scan 'CAR_ARCHIVE' , {COLUMNS=>'A', STARTROW => > '110\x00' , LIMIT=>1} > ROW > COLUMN+CELL > > 12\x0010123\x0019XFB2F56CE026679\x00\x80\x00\x00\x0 column=A:BODYSTYLE, > timestamp=1432899595317, > value=SEDAN > > 0 > > 12\x0010123\x0019XFB2F56CE026679\x00\x80\x00\x00\x0 > column=A:BODYSTYLESLUG, timestamp=1432899595317, value=sedan. > > I do have this rowkey: 110\x0033078\x001C4AJWAG0CL260823\x00\x80\x00\x00 > So, i was expecting to get that row. > > > Solution: scan 'CAR_ARCHIVE' , {COLUMNS=>'A', STARTROW => "110\x00" , > LIMIT=>1} > > I dont really know what's the difference between single quotes and double > quotes in startrow. Can anyone explain? Also, It would help others, if it > can be documented somewhere. > > Thanks, > Anil > > > On Mon, Jun 8, 2015 at 4:07 PM, Jean-Marc Spaggiari < > jean-marc@spaggiari.org > > wrote: > > > Hi Anil, > > > > Can you please clarify what seems to be wrong for you? > > > > You asked for start row "33078". Which mean Rows starting with a "3", > > followed by a "3", a "0", etc. and the first row returned start with a > "4" > > which is correct given the startrow you have specified. > > > > You seems to have a composite key. And you seems to scan without building > > the composite key. How have you created your table and what is your key > > design? > > > > JM > > > > 2015-06-08 16:56 GMT-04:00 anil gupta : > > > > > Hi All, > > > > > > I m having a lot of trouble dealing with HBase shell. I am running > > > following query: > > > > > > scan 'CAR_ARCHIVE' , {COLUMNS=>'A', STARTROW => '33078' , LIMIT=>1} > > > > > > ROW > > > COLUMN+CELL > > > > > > 4\x0010135\x001C4BJWEG2CL117550\x00\x7F\xFF\xFF\xFF > > > column=A:BODYSTYLE, timestamp=1430280906358, value=SPORT > > > UTILITY > > > > > > 4\x0010135\x001C4BJWEG2CL117550\x00\x7F\xFF\xFF\xFF > > > column=A:BODYSTYLESLUG, timestamp=1430280906358, > > > value=sport-utility > > > > > > 4\x0010135\x001C4BJWEG2CL117550\x00\x7F\xFF\xFF\xFF > > > column=A:CARFAXREPORTAVAILABLE, timestamp=1430280906358, > > > value=\x01 > > > > > > 4\x0010135\x001C4BJWEG2CL117550\x00\x7F\xFF\xFF\xFF > > > column=A:CARTYPE, timestamp=1430280906358, value={"isLuxury": false, > > > "isTruck": false, "isSedan": false, "isCoupe": false, "isSuv": true, > > > "isConvertible": false, "isVan": false, "isWagon": false, > > > "isEasyCareQualified": true} > > > > > > I specified, startRow='33078'. Then how come this result shows up? > What's > > > going over here? > > > > > > -- > > > Thanks & Regards, > > > Anil Gupta > > > > > > > > > -- > Thanks & Regards, > Anil Gupta > --001a1139f386888a1805180e1efa--