Return-Path: Delivered-To: apmail-hadoop-hbase-user-archive@minotaur.apache.org Received: (qmail 88529 invoked from network); 29 Aug 2009 17:01:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Aug 2009 17:01:00 -0000 Received: (qmail 71522 invoked by uid 500); 29 Aug 2009 17:00:59 -0000 Delivered-To: apmail-hadoop-hbase-user-archive@hadoop.apache.org Received: (qmail 71497 invoked by uid 500); 29 Aug 2009 17:00:59 -0000 Mailing-List: contact hbase-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-user@hadoop.apache.org Delivered-To: mailing list hbase-user@hadoop.apache.org Received: (qmail 71487 invoked by uid 99); 29 Aug 2009 17:00:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Aug 2009 17:00:59 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of saint.ack@gmail.com designates 74.125.92.27 as permitted sender) Received: from [74.125.92.27] (HELO qw-out-2122.google.com) (74.125.92.27) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Aug 2009 17:00:46 +0000 Received: by qw-out-2122.google.com with SMTP id 8so704541qwh.35 for ; Sat, 29 Aug 2009 10:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=Yx19LRo5LrXfMzr2hOEdL5ZXBpYJqVtk6kYQkOkfjfE=; b=OjbsQFjGcB2IFYUyzSnX+DdC34bkJY4M5PxRggcF71WpejQIIsSj+CHHfWE8bRUVxu gA8XozrkGG2A14y8DS0XZQSugnoBW3mjfvGNRCTtlTv0Z3wukbMjEKPwDpUoc6l1Chrj FglsHAVfW1vZ3Cwds7ZZgIpct9ohQnFulzBZA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=gEpHPaWsJrivq8fes0OsbkHbEmPtGjrzBz5DSxY7SaDkJZuJZ1dfyhziMzMx0mcWD8 pSWiX/wNaHsDVe1p7x+IiwcBftzAuRKcdYpvFtF/y6mXfs9D4kgGXes5u8AoPoxRFQ0I 2nML9idweJ94iQT3OyGhgPx5CBz0HGRhnIsyo= MIME-Version: 1.0 Sender: saint.ack@gmail.com Received: by 10.229.93.8 with SMTP id t8mr1104295qcm.82.1251565225459; Sat, 29 Aug 2009 10:00:25 -0700 (PDT) In-Reply-To: <2d789610908281359o77753ff9hd95462991ef8f235@mail.gmail.com> References: <2d789610908281359o77753ff9hd95462991ef8f235@mail.gmail.com> Date: Sat, 29 Aug 2009 10:00:25 -0700 X-Google-Sender-Auth: d352d2371d6231c5 Message-ID: <7c962aed0908291000w7d3d19a4taec26e9ee10576c9@mail.gmail.com> Subject: Re: Getting all the different timestamp values for a column From: stack To: hbase-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=000e0cd6a918ad40fa04724abcf4 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd6a918ad40fa04724abcf4 Content-Type: text/plain; charset=ISO-8859-1 You have to be using 0.20.0 RC2 to do the below. The below also presumes that each value has a different timestamp; i.e. you don't expect to add multiple values against same timestamp. // Presumes you already have a table instance named 'table'. Scan scan = new Scan(Bytes.toBytes("ID1:ID2")); scan.addColumn(Bytes.toBytes("family_name"), Bytes.toBytes("qualifier_term")); scan.setTimeStamp(ts); // This gets all from the timestamp and older. Use setTimeRange if you want to set a range. // Optionally, if you want to cap versions returned, see setMaxVersions. ResultScanner scanner = table.getScanner(scan); ..... The above is how I'd do it. Elegance is a tag I'm rarely associated with so there may be a better way... Hopefuly this helps St.Ack On Fri, Aug 28, 2009 at 1:59 PM, Nikhil Gupta wrote: > Hi, > > I am new to HBase, so please forgive if this question is too basic. > > We are building a system that stores time series data for different terms > in > column qualifiers. > So, we plan to store data in the form : > KeyID -> "ID1:ID2" > Family:Qualifier -> "family_name:qualifier_term" > Values -> Traffic for that term with different timestamps > > We will pull this data to display a trends kind of chart on front end. > Now if I want to get all the values for different timestamps for a > particular column while scanning, how can I do that via a scanner in the > most elegant manner ? > > [assuming that I know exact values for id1:id2 but not for qualifier_term.] > > Thanks > -nikhil > http://stanford.edu/~nikgupta > --000e0cd6a918ad40fa04724abcf4--