Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0E901E4F8 for ; Tue, 26 Feb 2013 05:58:19 +0000 (UTC) Received: (qmail 31166 invoked by uid 500); 26 Feb 2013 05:58:18 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 31017 invoked by uid 500); 26 Feb 2013 05:58:18 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 30494 invoked by uid 99); 26 Feb 2013 05:58:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2013 05:58:16 +0000 Date: Tue, 26 Feb 2013 05:58:16 +0000 (UTC) From: "ramkrishna.s.vasudevan (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-7928) Scanning .META. with startRow and/or stopRow is not giving proper results MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-7928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13586825#comment-13586825 ] ramkrishna.s.vasudevan commented on HBASE-7928: ----------------------------------------------- Ok so solved the problem. As Stack correctly said, incase of META the entry is nothing but the regioninfos. So which means it has the regionname followed by two commas and the region id. {code} a,,1361857755997.2309408bd4369ee6e7c0ccbaa0bf61fa {code} So when the user tries to set the start row as 'b'. The METAKEYCOMPARATOR tries to search for ',' in the key. In our case this is not found. So ideally what we should do is append ",,00000000000000" in case of start row and incase of stoprow ",,99999999999999". This will help us to exactly apply start and stop row for META scan. Now one thing to see is at what level should we do this, Because in case of META scans internally happening we already have the current format in it. Only an user induced META scan has to undergo some changes to the start and stop row. I tweaked and got the required output but that is just ugly. Could someone suggest a better approach? > Scanning .META. with startRow and/or stopRow is not giving proper results > ------------------------------------------------------------------------- > > Key: HBASE-7928 > URL: https://issues.apache.org/jira/browse/HBASE-7928 > Project: HBase > Issue Type: Bug > Affects Versions: 0.94.5 > Reporter: Jean-Marc Spaggiari > Assignee: ramkrishna.s.vasudevan > > {code} > try { > HTable metaTable = new HTable(config, Bytes.toBytes(".META.")); > Scan scan = new Scan(); > scan.setStartRow(Bytes.toBytes("e")); > scan.setStopRow(Bytes.toBytes("z")); > ResultScanner scanner = metaTable.getScanner(scan); > Result[] results = scanner.next(100); > while (results.length > 0) { > for (Result result : results) { > System.out.println(Bytes.toString(result.getRow())); > } > results = scanner.next(100); > } > scanner.close(); > metaTable.close(); > } catch (Exception e) { > e.printStackTrace(); > } > {code} > This code will not return any result even if there is 10 tables with names starting with "d" to "w", including one table called "entry". If you comment the setStopRow you will get results, but will still get rows starting with "d" even if setStartRow is set to "e". > Same code using with a user table is working fine. > Facing the same issue with the shell. > scan '.META.' , {STARTROW => 'e', LIMIT => 10} is returning rows starting by "d". > scan '.META.' , {STARTROW => 'e', STOPROW => 'v', LIMIT => 10} is not returning anything. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira