Return-Path: Delivered-To: apmail-hbase-user-archive@www.apache.org Received: (qmail 92811 invoked from network); 14 Dec 2010 23:29:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Dec 2010 23:29:13 -0000 Received: (qmail 40275 invoked by uid 500); 14 Dec 2010 23:29:12 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 40178 invoked by uid 500); 14 Dec 2010 23:29:12 -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 40170 invoked by uid 99); 14 Dec 2010 23:29:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Dec 2010 23:29:12 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bryanck@gmail.com designates 209.85.216.41 as permitted sender) Received: from [209.85.216.41] (HELO mail-qw0-f41.google.com) (209.85.216.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Dec 2010 23:29:04 +0000 Received: by qwa26 with SMTP id 26so1276117qwa.14 for ; Tue, 14 Dec 2010 15:28:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:content-type :content-transfer-encoding:subject:date:message-id:to:mime-version :x-mailer; bh=55L03OqGgEv+zPimSZxdz0DuoI6l0ZIzaoNpjcgzLsU=; b=Wgc1HevnTHm28wk0YdsZPDUs0GwcG3jaSCk+NwXr7VN1bLc04Qp+N/fVThv0Q1uNAE 6Sp0np1L33/WCZTTSdZCRCEstZuzeMg7bGOau0x3Jcp1TYakdWsp1H3HNcV6xDKhvRlP r0XvMtuwwvDNUcx+YjvY/Kv0dRyAeUG9Gfqew= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=PcIRNcio6+y/bc561vGTVj2rV1u4CDjHTlch6JgHnGdLv0DkJubIQEpY/ouV1OIXWU I/LonS5ETP73LrsyCVe1c7BohNL9xJEmQwruvScSaI51/K6uzV8FYgs0JoTZW4IHiSyF Eu1Z7Fz7nk/pBlEcNFhHsl82OXHF6tNYz3iSM= Received: by 10.229.181.74 with SMTP id bx10mr235210qcb.215.1292369323758; Tue, 14 Dec 2010 15:28:43 -0800 (PST) Received: from [10.41.41.88] ([216.55.28.254]) by mx.google.com with ESMTPS id u2sm305397qcq.43.2010.12.14.15.28.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 14 Dec 2010 15:28:42 -0800 (PST) From: Bryan Keller Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Composite key, scan on partial key Date: Tue, 14 Dec 2010 15:28:39 -0800 Message-Id: <12888295-58CB-4277-BB10-49A7117FD045@gmail.com> To: user@hbase.apache.org Mime-Version: 1.0 (Apple Message framework v1082) X-Mailer: Apple Mail (2.1082) I had a question about using a Scan on part of a composite key. Say I = have order line item rows, and the ID is order ID + line item ID. Each = ID is a random string. I want to get all line items for an order with my = Scan object. Setting the startRow on Scan is easy enough, just set it to the order ID = and leave off the line item ID. However, because endRow is exclusive, I = need to come up with a key that is just past the order ID. This would be = straightforward if the keys are numeric (just add one to the order ID), = but becomes kind of a kludge when the keys are strings. Right now I build the keys with a byte separator between the two strings = and set it to 0 when storing. Then when I want to scan, I create the = startRow with the Order ID + (byte)0, and the endRow with Order ID + = (byte)1. Seems like kind of a waste to have that extra byte just for = this purpose, though. Is there a better approach, like specifying the = endRow inclusively?=