Search code examples
hbase

scan.addcolumn or qualifierfilter to retrieve values


To retrieve values of a specific column in Hbase, should I use scan.addcolumn or qualifierfilter?

Which method gives better performance?


Solution

  • If you already know the qualifier, then you must use scan.addColumn(). If you are not sure about the qualifier and you want to compare the qualifier with a particular value (using operators like greater, less, equal etc), then you must use QualifierFilter. It is mentioned in the HBase documentation of QualifierFilter-

    If an already known column qualifier is looked for, use Get.addColumn(byte[], byte[]) directly rather than a filter.