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 1468A11809 for ; Fri, 25 Apr 2014 01:24:41 +0000 (UTC) Received: (qmail 83150 invoked by uid 500); 25 Apr 2014 01:24:37 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 83040 invoked by uid 500); 25 Apr 2014 01:24: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 83032 invoked by uid 99); 25 Apr 2014 01:24:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Apr 2014 01:24:36 +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 (nike.apache.org: domain of lslusser@gmail.com designates 209.85.192.50 as permitted sender) Received: from [209.85.192.50] (HELO mail-qg0-f50.google.com) (209.85.192.50) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Apr 2014 01:24:31 +0000 Received: by mail-qg0-f50.google.com with SMTP id 63so3419312qgz.9 for ; Thu, 24 Apr 2014 18:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=p8kpGistu/mFZkE+97k6gE6QRWNAWt3lJWJTacTIHh4=; b=VMan+keXdN9SwrwjAB5K7r2p6E62xz1alFS04cKpbeemF0P0i6BsJN0K0FTo60QG7P dnzauemY8XqJ+J+eNmYmvWoqqmKV5CoIaz8KFcYD5Z63fVDv9GT/+keiA8oQuV+Joz7F LfWOr1KtZ/RukRb67BfLq+hJ2iJKgDqgweuV/DF2uhDjlfAyOkh+VFIqn7xyr6zz6t7w fjzIOnjEfE13rRatpXlayMOhqDMjtS2zniHkt9Qy43c1SNY1mDqyUmGdYlE12LgraG42 Xp0KmXsXO55kVB7HDDrcTVIP3abe6ajTpJFXb/oy5dEVRTbHvN919MfqEZaOU+Oxz2l0 Ye6g== MIME-Version: 1.0 X-Received: by 10.224.26.71 with SMTP id d7mr7504792qac.29.1398389048397; Thu, 24 Apr 2014 18:24:08 -0700 (PDT) Received: by 10.96.42.39 with HTTP; Thu, 24 Apr 2014 18:24:08 -0700 (PDT) Date: Thu, 24 Apr 2014 18:24:08 -0700 Message-ID: Subject: FuzzyRowFilter weird results From: Liam Slusser To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=089e0149c5107d1ad604f7d3d282 X-Virus-Checked: Checked by ClamAV on apache.org --089e0149c5107d1ad604f7d3d282 Content-Type: text/plain; charset=UTF-8 Hey All - I'm having some strange results using FuzzyRowFilter. I'm programming in jython for that extra bit of adventure. My hbase key looks something like [random 10bytes][servicetype 12bytes][timestamp 10bytes] = 32 bytes total. For an example key e23d4ac4b90002000100011398388474 So the following code will find the above key: filter = FuzzyRowFilter([ Pair(array('b', "e\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00"), array('b', [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]))]) But I'm only able to match at the beginning of the key, never the middle or at the end. This will not find the above key: filter = FuzzyRowFilter([ Pair(array('b', "e\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x004"), array('b', [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0]))]) Am I doing something wrong? Is there a better way to search for keys? Really I'm going to want to search on the 12-byte service-type. Here is the full jython code: from array import array from org.apache.hadoop.hbase.util import Pair from org.apache.hadoop.hbase import HBaseConfiguration from org.apache.hadoop.hbase.client import HBaseAdmin, HTable, Scan from org.apache.hadoop.hbase.filter import FuzzyRowFilter conf = HBaseConfiguration() filter = FuzzyRowFilter([ Pair(array('b', "e\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00"), array('b', [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1])) ]) scan = Scan() scan.setFilter(filter) table = HTable(conf,'mytable') s = table.getScanner(scan) while True: r = s.next() if not r: break else: print r --089e0149c5107d1ad604f7d3d282--