hbase GREATER_OR_EQAUL 运算符未按预期工作

hbase GREATER_OR_EQAUL operator does not work as expected

我的 hbase 中有这一行 table: {rowkey:1_1611646861574/cf:value/1611646776287/Put/vlen=8/seqid=0} 现在我想做一个简单的扫描并找到列值大于“1611388300000”的行。但它没有 return 任何记录;然而,当我使用 LESS_OR_EQUAL 而不是 1611647500000 时,它 return 是这个记录。 奇怪的是我可以从 apache phoenix sql 查询中获取此记录:select * 来自 my_table where value>=1611388300000.

所以数字明显大于列值和 apache phoenix returns 它;为什么 hbase 没有比较运算符?

这是我的代码:

Table table = con.getTable(TableName.valueOf("my_table"));
Scan scan = new Scan();
scan.addColumn(Bytes.toBytes("cf"), Bytes.toBytes("value"));
FilterList flist = new FilterList(FilterList.Operator.MUST_PASS_ALL);
flist.addFilter(new PrefixFilter(Bytes.toBytes("1")));
flist.addFilter(new SingleColumnValueFilter(
                        Bytes.toBytes("cf"), Bytes.toBytes("value"), CompareOperator.GREATER_OR_EQUAL,
                        new BinaryComparator(Bytes.toBytes("1611388300000"))));
scan.setFilter(flist);
ResultScanner scanner = table.getScanner(scan);
for (Result result = scanner.next(); result != null; result = scanner.next())
     System.out.println("Found row : " + result);
scanner.close();

我不完全知道为什么,但 LESS_OR_EQUAL 适用于字符串:

new SingleColumnValueFilter(
                    Bytes.toBytes("cf"), Bytes.toBytes("value"), CompareOperator.LESS_OR_EQUAL,
                    new BinaryComparator(Bytes.toBytes("1611647500000")))

但是 GREATER_OR_EQUAL 在我使用引号时不起作用,所以我不得不使用数字(添加 L 以指定 Long)

new SingleColumnValueFilter(
                        Bytes.toBytes("ui"), Bytes.toBytes("C"), CompareOperator.GREATER_OR_EQUAL,
                        new BinaryComparator(Bytes.toBytes(1611388300000L)))