twinsdestiny
V2EX  ›  数据库

HBase 使用 SingleColumnValueFilter 值过滤问题

  •  
  •   twinsdestiny · May 17, 2021 · 962 views
    This topic created in 1842 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   ·   5410 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 09:23 · PVG 17:23 · LAX 02:23 · JFK 05:23
    ♥ Do have faith in what you're doing.