Return-Path: Delivered-To: apmail-hbase-user-archive@www.apache.org Received: (qmail 56472 invoked from network); 28 May 2010 16:06:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 May 2010 16:06:27 -0000 Received: (qmail 79763 invoked by uid 500); 28 May 2010 16:06:26 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 79731 invoked by uid 500); 28 May 2010 16:06:26 -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 79723 invoked by uid 500); 28 May 2010 16:06:26 -0000 Delivered-To: apmail-hadoop-hbase-user@hadoop.apache.org Received: (qmail 79720 invoked by uid 99); 28 May 2010 16:06:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 16:06:26 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of oliver.meyn@zerofootprint.net designates 209.85.212.48 as permitted sender) Received: from [209.85.212.48] (HELO mail-vw0-f48.google.com) (209.85.212.48) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 16:06:17 +0000 Received: by vws1 with SMTP id 1so178120vws.35 for ; Fri, 28 May 2010 09:05:52 -0700 (PDT) Received: by 10.220.128.37 with SMTP id i37mr363387vcs.50.1275062499416; Fri, 28 May 2010 09:01:39 -0700 (PDT) Received: from [192.168.1.190] ([206.223.182.122]) by mx.google.com with ESMTPS id z17sm10308165vco.5.2010.05.28.09.01.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 28 May 2010 09:01:38 -0700 (PDT) Message-Id: <3EF5E168-09A0-4FC9-ADBC-FC98D8172104@zerofootprint.net> From: Oliver Meyn To: hbase-user@hadoop.apache.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: how to get the row before this one? Date: Fri, 28 May 2010 12:01:34 -0400 X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I have a table "device_power" which has as its row key "device_id.timestamp", and a single column, "power". A new row is written whenever the power consumption of a device changes, which could be every second, or could be as much as days. When I do a query like "what was the average power of device X between Date 1 and Date 2" I can get all keys where device_id matches X (using PrefixFilter) and timestamp > Date1 and < Date2 (using either RowFilter or setTimeRange). But I also need the last row before my time range to know what state the device was in at the start of my query period. Maybe an example will help make it more obvious (my timestamps are long integers, but this is easier to read): DevA.9am, 100W DevB.10am, 200W DevB.11am, 150W DevA.12pm, 150W And now the query "What was the average power of DevA btw 10am and 1pm". Is there a clever way to "get the first row before 10am that matches PrefixFilter("DevA") ? Thanks, Oliver