Code Monkey home page Code Monkey logo

simplehbase's Issues

rowkey

简单看了下ppt中举的例子,发现个问题:rowkey存储的数据,貌似在qualifier里面也存储了一份。是么?

hbase的count竟然不兼容

老版本的hbase count时可以用不存在的列count,结果是包含该行的。
较新版本的hbase count时用不存在的列count,结果是0。

@Test
public void testCount_NonExistColumn() throws Throwable {
    LongColumnInterpreter columnInterpreter = new LongColumnInterpreter();
    AggregationClient aggregationClient = new AggregationClient(
            Config.getConfiguration());

    Scan scan = new Scan();
    scan.addColumn(ColumnFamilyName, QName_NotExistColumn);

    Long count = aggregationClient.rowCount(TableNameBytes,
            columnInterpreter, scan);
    //        Assert.assertTrue(count.longValue() == 4);
    Assert.assertTrue(count.longValue() == 0);
}

Scan with filter 0.94.0 0.94.9 0.94.24 0.98.8不兼容

Scan with filter

使用scan.addColumn()时
0.94.0 0.94.9 一致
0.94.24和其他版本不一致

在0.94.0 0.94.9 中,当scan.addColumn()时,无论该column是否和filter中的column一致,该filter都是生效的。
区别在于返回的行不同。

当addColumn为Q1,先选择出

rowkey          f/q1            f/q2           f/q3   
1               1                2  
2               4                8  
3               16    
5               64               NULL  
6               NULL             128  
7               NULL             NULL  

然后filter出

rowkey          f/q1            f/q2           f/q3   
2               4                8  
3               16    
5               64               NULL  

当addColumn为Q2,先选择出

rowkey          f/q1            f/q2           f/q3   
1               1                2  
2               4                8  
4                                32  
5               64               NULL  
6               NULL             128  
7               NULL             NULL  

然后filter出

rowkey          f/q1            f/q2           f/q3   
2               4                8  
4                                32  
5               64               NULL  

在0.94.24和0.98.8中,当scan.addColumn()时,如果column和filter中的column不一致,该filter不生效的。

当addColumn为Q2,先选择出

rowkey          f/q1            f/q2           f/q3   
1               1                2  
2               4                8  
4                                32  
5               64               NULL  
6               NULL             128  
7               NULL             NULL  

然后filter不生效,返回结果。

使用scan.addFamily()时
3个版本功能一致。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.