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 450E19B94 for ; Thu, 26 Jul 2012 21:14:14 +0000 (UTC) Received: (qmail 24473 invoked by uid 500); 26 Jul 2012 21:14:11 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 24429 invoked by uid 500); 26 Jul 2012 21:14:10 -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 24418 invoked by uid 99); 26 Jul 2012 21:14:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jul 2012 21:14:10 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of saint.ack@gmail.com designates 209.85.213.41 as permitted sender) Received: from [209.85.213.41] (HELO mail-yw0-f41.google.com) (209.85.213.41) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jul 2012 21:14:04 +0000 Received: by yhr47 with SMTP id 47so3019923yhr.14 for ; Thu, 26 Jul 2012 14:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=+5eZTGvaEFy8rdr/lqblEePFH4z1C599h8b8S9le+Ww=; b=W6Q8YXE0L/IxYMz5b+dhpnuu+7YEQLC5sGMVc36bVfT6PpGrJ/hfXAr3plsx6ovSS0 kjFcrKuyuVPWERZsoyZZjTo6o7XMtMUCfxlwbrohSJvsMJGO8yAkn4OFcJwwdGUQCStY LFlt7orJwcWor4X3yIxKQMuEoCPdLrNVmV39bRH1F8k3HEtCkyP+ICcE3YzGsXeUisrx iM8Rzrltx36f/WID85wtmCDJH2rBWt7fE75JzhjVihpozhSYizldE2+1AgIGWRxM3M61 7mZ3Exw2XLstuS+c27PSmLVIg80ZONsuFf4ItxZGeh8dOZ5kmOmqWEfxUxPgScujaTK2 HiDQ== MIME-Version: 1.0 Received: by 10.66.76.196 with SMTP id m4mr322101paw.61.1343337223327; Thu, 26 Jul 2012 14:13:43 -0700 (PDT) Sender: saint.ack@gmail.com Received: by 10.66.16.202 with HTTP; Thu, 26 Jul 2012 14:13:43 -0700 (PDT) In-Reply-To: References: Date: Thu, 26 Jul 2012 23:13:43 +0200 X-Google-Sender-Auth: b8J3RmcS2RtGIjgGpMbXX-mebxo Message-ID: Subject: Re: Query a version of a column efficiently From: Stack To: user@hbase.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Jul 26, 2012 at 7:43 PM, Jerry Lam wrote: > I need some advises on a problem that I'm facing using HBase. How can I > efficiently query a version of a column when I don't know exactly the > version I'm looking for? > For instance, I want to query a column with timestamp that is less or equal > to N, if version = N is available, return it to me. Otherwise, I want the > version that is closest to the version N (order by descending of > timestamp). That is if version = N - 1 exists, I want it to be returned. > Have you tried a timerange w/ minStamp of N and maxStamp of HConstants#LATEST_TIMESTAMP Long.MAX_VALUE) returning one version only (setMaxVersion(1))? St.Ack