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 1572910544 for ; Wed, 6 Nov 2013 01:29:11 +0000 (UTC) Received: (qmail 25721 invoked by uid 500); 6 Nov 2013 01:29:09 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 25641 invoked by uid 500); 6 Nov 2013 01:29:08 -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 25633 invoked by uid 99); 6 Nov 2013 01:29:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Nov 2013 01:29:08 +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 (athena.apache.org: domain of premal.j.shah@gmail.com designates 209.85.220.179 as permitted sender) Received: from [209.85.220.179] (HELO mail-vc0-f179.google.com) (209.85.220.179) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Nov 2013 01:29:04 +0000 Received: by mail-vc0-f179.google.com with SMTP id hz11so6276677vcb.10 for ; Tue, 05 Nov 2013 17:28:44 -0800 (PST) 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=gTbYLr2W3dM5bVXI6ZZ4yb7v06AhgGhLxKqne0roExI=; b=lDbeuG6jO0S1rY6mP9NyMMfcwc5vrMzbYviABMnY78npdh5BlaUkWfeJOUpS1QzUHR mQbcyjr2dhlmcdaKhEYpn8UR2txqkSMT7n2rjZ0/dUP6zSBqgS93yEH00bWpfCMJK509 m13mWj2NyDCl0OG7PTj5+G9ugQuB/rl3cLLHK4beK3EQvXv2YFQBSGes/dPdy2kr2GPI Z1QZyC/ZYlt/nddNaFUhVcDE78aW4Rj36zg1eiUyW0RfOdA2ZlGC8bxy0f/YfNg0UbYW IeSHvHxRfppQZ7HUlXfhJ17gIxgpde7QP1kmpkKcxSBZ1aAlwCHx+Bs+l9DKgHJ95LPq wJHg== MIME-Version: 1.0 X-Received: by 10.52.249.3 with SMTP id yq3mr51166vdc.55.1383701290809; Tue, 05 Nov 2013 17:28:10 -0800 (PST) Received: by 10.220.145.19 with HTTP; Tue, 5 Nov 2013 17:28:10 -0800 (PST) In-Reply-To: References: Date: Tue, 5 Nov 2013 17:28:10 -0800 Message-ID: Subject: Re: Column qualifiers with hierarchy and filters From: Premal Shah To: user Content-Type: multipart/alternative; boundary=089e01176257ea04a704ea780fb9 X-Virus-Checked: Checked by ClamAV on apache.org --089e01176257ea04a704ea780fb9 Content-Type: text/plain; charset=ISO-8859-1 you can store the byte representation of the integer (fixed length) instead of the integer (which will be stored as strings of variable length) and will also be sorted. On Tue, Nov 5, 2013 at 1:58 PM, Nasron Cheong wrote: > Yes, its limited in the sense that we have to precalculate the number of > digits required so we don't run out, and if we overestimate, then our row > keys end up taking up more space than we'd care to. > > We can probably live with this approach for now, but I wonder if there's a > better way. > > - Nasron > > > On Tue, Nov 5, 2013 at 12:28 PM, Jean-Marc Spaggiari < > jean-marc@spaggiari.org> wrote: > > > Hi Nasron, > > > > Why are you saying that it's a limited way? Does it achieve your needs? > > > > > > 2013/11/4 Nasron Cheong > > > > > An example query would be the following, say the column qualifier was > of > > > the form > > > > > > : > > > > > > where should be an integer value, and msg type is a string. > > E.g. > > > > > > 1:abc > > > 1000:abc > > > 2: abc > > > > > > would appear in the above sequence, which is out of order when doing > > prefix > > > filtering. Zero padding could fix this: > > > > > > 0001:abc > > > 0002:abc > > > 1000: abc > > > > > > But is a limited way of ensuring the sequence of CQ (column qualifiers) > > is > > > correct, in order for prefix filtering to work. Are there other > options? > > > > > > - Nasron > > > > > > > > > On Thu, Oct 31, 2013 at 9:19 PM, Nasron Cheong > > > wrote: > > > > > > > Hi, > > > > > > > > I'm trying to determine the best way to serialize a sequence of > > > > integers/strings that represent a hierarchy for a column qualifier, > > which > > > > would be compatible with the ColumnPrefixFilters, and > > BinaryComparators. > > > > > > > > However, due to the lexicographical sorting, it's awkward to > serialize > > > the > > > > sequence of values needed to get it to work. > > > > > > > > What are the typical solutions to this? Do people just zero pad > > integers > > > > to make sure they sort correctly? Or do I have to implement my own > > > > QualifierFilter - which seems expensive since I'd be deserializing > > every > > > > byte array just to compare. > > > > > > > > Thanks > > > > > > > > - Nasron > > > > > > > > > > -- Regards, Premal Shah. --089e01176257ea04a704ea780fb9--