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 168539D0A for ; Thu, 9 Feb 2012 19:57:54 +0000 (UTC) Received: (qmail 58506 invoked by uid 500); 9 Feb 2012 19:57:52 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 58330 invoked by uid 500); 9 Feb 2012 19:57: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 58317 invoked by uid 99); 9 Feb 2012 19:57:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2012 19:57: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 (athena.apache.org: domain of aa.vasilenko@gmail.com designates 209.85.213.169 as permitted sender) Received: from [209.85.213.169] (HELO mail-yx0-f169.google.com) (209.85.213.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2012 19:57:44 +0000 Received: by yenl5 with SMTP id l5so1393826yen.14 for ; Thu, 09 Feb 2012 11:57:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=K5boyqbBX6RrEqhN7D6JsIJPERqFFqIb1stjSfCdWM0=; b=Ex2HkW62pG4Bin2TxergnOuAylsu6TLxsnoJuJZYv5bYktiPx5mWG1OVchl28PTw/9 R93IYxjpFoQ/GjInHMQKh+AvmMrEVyoFUfuByHL5puOVL/FqEsRu45DK6zgRBCN2+aXG 8835oTbPJTs32pmWI8shgGZcevQGbrK5rCz/4= Received: by 10.236.124.17 with SMTP id w17mr4709288yhh.26.1328817444215; Thu, 09 Feb 2012 11:57:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.153.69 with HTTP; Thu, 9 Feb 2012 11:57:04 -0800 (PST) In-Reply-To: References: <1328812425.45012.YahooMailNeo@web121703.mail.ne1.yahoo.com> <1328814206.80929.YahooMailNeo@web121704.mail.ne1.yahoo.com> From: Alex Vasilenko Date: Thu, 9 Feb 2012 21:57:04 +0200 Message-ID: Subject: Re: row filter - binary comparator at certain range To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=20cf300e4fbfbbdb3504b88d6b6d --20cf300e4fbfbbdb3504b88d6b6d Content-Type: text/plain; charset=ISO-8859-1 Ted, Scan#setTimeRange filters columns, not rows, I think it's not optimal, because all rows, including columns will be read. In case of BinaryRangeComparator rows not in range will be filtered out earlier. Thanks, Alexandr Vasilenko 2012/2/9 Ted Yu > Alex: > Does the timestamp below reflect actual time ? > If so, take a look at the following method (and its javadoc) in Scan.java: > public Scan setTimeRange(long minStamp, long maxStamp) > > Cheers > > On Thu, Feb 9, 2012 at 11:08 AM, Alex Vasilenko >wrote: > > > Lars, > > > > But how it will behave, when I have salt at the beginning of the key to > > properly shard table across regions? Imagine row key of format > > salt:timestamp and rows goes like this: > > ... > > 1:15 > > 1:16 > > 1:17 > > 1:23 > > 2:3 > > 2:5 > > 2:12 > > 2:15 > > 2:19 > > 2:25 > > ... > > > > And I want to find all rows, that has second part (timestamp) in range > > 15-25. What startKey and endKey should be used? > > > > Alexandr Vasilenko > > Web Developer > > Skype:menterr > > mob: +38097-611-45-99 > > > > > > 2012/2/9 lars hofhansl > > > > > Sorry misunderstood your question. > > > > > > In that case you'd just use a scanner (see Scan.java) and set that > > > startKey and the endKey. > > > That will give you that range of keys and it do so efficiently, as it > can > > > seek forward to the startKey. > > > > > > -- Lars > > > > > > > > > > > > ________________________________ > > > From: Alex Vasilenko > > > To: user@hbase.apache.org > > > Sent: Thursday, February 9, 2012 10:40 AM > > > Subject: Re: row filter - binary comparator at certain range > > > > > > Lars, > > > > > > I meant range of row keys. BinaryPrefixComparator can be used in > > > conjunction with RowFilter to filter by prefix. > > > > > > Alex > > > > > > 2012/2/9 lars hofhansl > > > > > > > Note the BinaryPrefixComparator compares values (not keys). > > > > Not sure that this is what you want, but you mention a "range of > key". > > > > > > > > > > > > For keys there are ColumnPrefixFilter and ColumnRangeFilter. > > > > > > > > > > > > -- Lars > > > > > > > > > > > > > > > > ________________________________ > > > > From: Alex Vasilenko > > > > To: user@hbase.apache.org > > > > Sent: Thursday, February 9, 2012 10:03 AM > > > > Subject: row filter - binary comparator at certain range > > > > > > > > Hi all, > > > > > > > > I'm a brand new user of hbase and hadoop in general. Trying to > evaluate > > > > hbase for our needs. Question is: why there's BinaryPrefixComparator, > > but > > > > no BinaryRangeComparator, where you specify what range of key should > be > > > > compared. Are there any concerns about using it? > > > > > > > > Thanks, > > > > Alexandr Vasilenko > > > > > > > > > > --20cf300e4fbfbbdb3504b88d6b6d--