tsuna/gohbase

how could we compare two numbers using filter when scan

LHLangHao opened this issue · 1 comments

When using the single column filters, I found that the numbers were compared in ascii code. For example, the number(which in string type) is "5", it is greater than "13". So does anyone know how to compare them as numbers? 13 > 5 expected.

dethi commented

For HBase and gohbase, the rowkey, the column qualifier and the values are just a byte array with no meaning. It's up to you to either:

  • encode your integer in a way that works with you are trying to achieve (like encoding number in reversed ASCII format, number 1324 -> 4231)
  • write custom HBase filters if needed