{"id":1776,"date":"2018-07-12T18:17:36","date_gmt":"2018-07-12T10:17:36","guid":{"rendered":"https:\/\/cowmanchiang.me\/wp\/?p=1776"},"modified":"2023-10-31T15:42:22","modified_gmt":"2023-10-31T07:42:22","slug":"hbase-filters-not-working-for-negative-integers","status":"publish","type":"post","link":"https:\/\/cowmanchiang.me\/wp\/?p=1776","title":{"rendered":"[HBase] Filters not working for negative integers"},"content":{"rendered":"<p><a href=\"https:\/\/stackoverflow.com\/questions\/17248510\/hbase-filters-not-working-for-negative-integers\" rel=\"noopener noreferrer\" target=\"_blank\">[stackoverflow] HBase: Filters not working for negative integers<\/a><\/p>\n<blockquote><p>Easility say:<br \/>\nSince, Hbase has only BinaryComparators and not other &#8216;typed&#8217; comparators, it fails to filter on Negative integers as it stores the 2&#8217;s compliment of the negative number. Further, the binary representation of a negative 2\u2019s Complement Integer would be lexicographically after the largest positive number and that&#8217;s why it was not working.<\/p>\n<p>The workaround is to change the signed bit of the number. Things are working fine after that. Please note that this is required only for integers and not for float types.<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>[stackoverflow] HBase: Filters not working for negative integers Easility say: Since, Hbase has only BinaryComparators and not other &#8216;typed&#8217; comparators, it fails to filter on Negative integers as it stores the 2&#8217;s compliment of the negative number. Further, the binary &hellip; <a href=\"https:\/\/cowmanchiang.me\/wp\/?p=1776\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-1776","post","type-post","status-publish","format-standard","hentry","category-hbase"],"_links":{"self":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1776","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1776"}],"version-history":[{"count":3,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1776\/revisions"}],"predecessor-version":[{"id":1852,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1776\/revisions\/1852"}],"wp:attachment":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}