twinsdestiny
V2EX  ›  数据库

HBase 使用 SingleColumnValueFilter 值过滤问题

  •  
  •   twinsdestiny · May 17, 2021 · 1103 views
    This topic created in 1925 days ago, the information mentioned may be changed or developed.

    在使用 SingleColumnValueFilter 时,发现直接写值和用 BinaryComparator 都过滤不出数据,使用 SubstringComparator 就可以,有懂的大佬解答一下吗?

    SingleColumnValueFilter filter = new SingleColumnValueFilter(Bytes.toBytes("f"),Bytes.toBytes("a"),CompareFilter.CompareOp.EQUAL,Bytes.toBytes("11111111111111"));//查不出数据
    SingleColumnValueFilter filter = new SingleColumnValueFilter(Bytes.toBytes("f"),Bytes.toBytes("a"),CompareFilter.CompareOp.EQUAL,new BinaryComparator(Bytes.toBytes("11111111111111")));//查不出数据
    SingleColumnValueFilter filter = new SingleColumnValueFilter(Bytes.toBytes("f"),Bytes.toBytes("a"),CompareFilter.CompareOp.EQUAL,new SubstringComparator("11111111111111"));//可以查到数据
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4188 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 04:12 · PVG 12:12 · LAX 21:12 · JFK 00:12
    ♥ Do have faith in what you're doing.