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 0FE9FC428 for ; Wed, 26 Jun 2013 08:22:48 +0000 (UTC) Received: (qmail 21284 invoked by uid 500); 26 Jun 2013 08:22:43 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 21214 invoked by uid 500); 26 Jun 2013 08:22:39 -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 21206 invoked by uid 99); 26 Jun 2013 08:22:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jun 2013 08:22:37 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jtaylor@salesforce.com designates 64.18.3.90 as permitted sender) Received: from [64.18.3.90] (HELO exprod8og105.obsmtp.com) (64.18.3.90) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 26 Jun 2013 08:22:31 +0000 Received: from exsfm-hub5.internal.salesforce.com ([204.14.239.233]) by exprod8ob105.postini.com ([64.18.7.12]) with SMTP ID DSNKUcqksSjBYgFIJ6ewEBkBKdxQTa2B9cIv@postini.com; Wed, 26 Jun 2013 01:22:10 PDT Received: from [10.0.54.31] (10.0.54.31) by exsfm-hub5.internal.salesforce.com (10.1.127.5) with Microsoft SMTP Server (TLS) id 8.3.279.5; Wed, 26 Jun 2013 01:22:09 -0700 Message-ID: <51CAA4B1.1040508@salesforce.com> Date: Wed, 26 Jun 2013 01:22:09 -0700 From: James Taylor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 MIME-Version: 1.0 To: Subject: Re: HBase: Filters not working for negative integers References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org You'll need to flip the sign bit for ints and longs like Phoenix does. Feel free to borrow our serializers (in PDataType) or just use Phoenix. Thanks, James On 06/26/2013 12:16 AM, Madhukar Pandey wrote: > Please ignore my previous mail..there was some copy paste issue in it.. > this is the correct mail.. > > > We have implemented QualifierFilter as well as ValueFilter (using > BinaryComparator) of Hbase successfully and they are working fine for most > of our cases. However they are failing in cases like number > -10 or number > < -10 > > Please note that number = -10 is working perfectly fine. Also, number > 10 > and number < 10 are also working fine. > > If you want to see the code, please check following links: > 1. QualifierFilter - Relevant lines are 126-142 > https://github.com/deanhiller/playorm/blob/master/src/main/java/com/alvazan/orm/layer9z/spi/db/hadoop/CursorColumnSliceHbase.java > > > 2. Value Filter - Relevant lines are 107-128 > https://github.com/deanhiller/playorm/blob/master/src/main/java/com/alvazan/orm/layer9z/spi/db/hadoop/CursorOfHbaseIndexes.java > > > As per this blog(http://flurrytechblog.wordpress.com/2012/06/12/137492485/), > this can be an issue with serialization if we want to store negative values > for rowkeys and we should write our own serializers for comparison. > So we wanted to know: > 1. Is it really necessary to write our own serializer in this case? > 2. If yes, how? Any example would be great help. > > > > > > On Wed, Jun 26, 2013 at 12:33 PM, Madhukar Pandey wrote: > >> We have implemented QualifierFilter as well as ValueFilter (using >> BinaryComparator) of Hbase successfully and they are working fine for >> most of our cases. However they are failing in cases like number > -10 or number >> < -10 >> >> Please note that number = -10 is working perfectly fine. Also, number > 10 >> and number < 10 are also working fine. >> >> If you want to see the code, please check following links: >> 1. QWe >> have implemented QualifierFilter as well as ValueFilter (using >> BinaryComparator) of Hbase successfully and they are working fine for most >> of our cases. However they are failing in cases like number > -10 or number >> < -10 >> >> >> Please note that number = -10 is working perfectly fine. Also, number > 10 >> and number < 10 are also working fine. >> >> >> If you want to see the code, please check following links: >> >> 1. QualifierFilter - Relevant lines are 126-142 >> >> 2. Value Filter - Relevant lines are 107-128 >> >> >> As per this blog, this can be an issue with serialization if we want to >> store negative values for rowkeys and we should write our own serializers >> for comparison. >> >> So we wanted to know: >> >> 1. Is it really necessary to write our own serializer in this case? >> >> 2. If yes, how? Any example would be great help.ualifierFilter - >> Relevant lines are 126-142 >> 2. Value Filter - >> Relevant lines are 107-128 >> >> As per this blog, >> this can be an issue with serialization if we want to store negative values >> for rowkeys and we should write our own serializers for comparison. >> So we wanted to know: >> 1. Is it really necessary to write our own serializer in this case? >> 2. If yes, how? Any example would be great help. >>