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 85C7510192 for ; Fri, 6 Dec 2013 21:49:40 +0000 (UTC) Received: (qmail 36573 invoked by uid 500); 6 Dec 2013 21:49:37 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 36497 invoked by uid 500); 6 Dec 2013 21:49:37 -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 36462 invoked by uid 99); 6 Dec 2013 21:49:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Dec 2013 21:49:37 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yuzhihong@gmail.com designates 209.85.192.181 as permitted sender) Received: from [209.85.192.181] (HELO mail-pd0-f181.google.com) (209.85.192.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Dec 2013 21:49:33 +0000 Received: by mail-pd0-f181.google.com with SMTP id p10so1714126pdj.12 for ; Fri, 06 Dec 2013 13:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=HxRnrw7XG8yvtR2gDOr4VlmF/YAyusafhexx1rW0H6k=; b=azjsqu7G7mfbvnrjaigUhA8O+zBqYD9KU1c13RrFxA41qQl5qigqDwe4ZSOrYan8tI bBzLYmpYWazj7sb0cDcHEVxCGBsHreWqa1C+m7kFkQj0HM3GzWARUND7pYNDlJskYy6L nO/KyDW3zYjEMiPUPU948eoWzwN+3JzmTgALJVgvEm/IAoDA95aFy8cnEldKM/ByiBqr L+JhiC5R3VPdrn4cG0jeag0pB+/IbGzso6OSGEMl5IGHYvD8cjgGaw9pvBsIAzA3De3E 7pNwkuIA99kSMs/kDh7rzFj1aEP3gnuFsJlx9lGcExC5pRoz8fCxRzQMoRgaaQ0LfQPR A5+g== MIME-Version: 1.0 X-Received: by 10.68.20.70 with SMTP id l6mr6450560pbe.152.1386366552817; Fri, 06 Dec 2013 13:49:12 -0800 (PST) Received: by 10.70.16.226 with HTTP; Fri, 6 Dec 2013 13:49:12 -0800 (PST) In-Reply-To: References: Date: Sat, 7 Dec 2013 05:49:12 +0800 Message-ID: Subject: Re: HBase returns old values even with max versions = 1 From: Ted Yu To: "user@hbase.apache.org" Content-Type: multipart/alternative; boundary=bcaec520e60be97b7804ece49d9a X-Virus-Checked: Checked by ClamAV on apache.org --bcaec520e60be97b7804ece49d9a Content-Type: text/plain; charset=ISO-8859-1 Before the second get command was executed, was there compaction on server side ? You can find out by going to region server hosting row 'r1' and check server log. Cheers On Sat, Dec 7, 2013 at 12:05 AM, Niels Basjes wrote: > Hi, > > I have the desire to find the columns that have not been updated for more > than a specific time period. > > So I want to do a scan against the columns with a timerange. > The normal behavior of HBase is that you then get the latest value in that > time range (which is not what I want). > > As far as I understand the way HBase should work is that if you set the > maximum number of versions for the values in a column family to '1' it > should retain only the last value that was put into the cell. > > What I found is different. > > If I do the following commands into the hbase shell > > create 't1', {NAME => 'c1', VERSIONS => 1} > put 't1', 'r1', 'c1', 'One', 1000 > put 't1', 'r1', 'c1', 'Two', 2000 > put 't1', 'r1', 'c1', 'Three', 3000 > get 't1', 'r1' > get 't1', 'r1' , {TIMERANGE => [0,1500]} > > the result is this: > > get 't1', 'r1' > COLUMN CELL > c1: timestamp=3000, value=Three > 1 row(s) in 0.0780 seconds > > get 't1', 'r1' , {TIMERANGE => [0,1500]} > COLUMN CELL > c1: timestamp=1000, value=One > 1 row(s) in 0.1390 seconds > > Why does the second query return a value even though I've set the max > versions to only 1? > I expect that it only 'knows' about the latest value ('Three') and thus > should return an empty result in the above example. > What is the correct way to obtain what I'm looking for? > > My current workaround is that I simply retrieve the latest value for all my > columns and filter them in my application code. > > The HBase version I currently have installed here is HBase 0.94.6-cdh4.4.0 > > -- > Best regards / Met vriendelijke groeten, > > Niels Basjes > --bcaec520e60be97b7804ece49d9a--