Skip to content

hbase的count竟然不兼容 #17

@zhang-xzhi

Description

@zhang-xzhi

老版本的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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions