SingleColumnValueFilter Support
Link66 opened this issue · comments
let filter = {
filter: {
"type": "SingleColumnValueFilter",
"op": "EQUAL",
"family": "cf",
"qualifier": "userid",
"comparator": {
"type": "BinaryComparator",
"value": "xxxxxxxx"
}
}
}
hbaseClient.table(tableName).scan(filter,(error, data) => { console.log(error); console.log(data); });
Execute the above code will return all the data in the database, it seems that the SingleColumnValueFilter didn't work, i don't know whether i missed some params.
let filter = { filter: { "type": "ValueFilter", "op": "EQUAL", "family": "cf", "qualifier": "userid", "comparator": { "type": "BinaryComparator", "value": "xxxxxxxxxxx" } } };
result:
And using the ValueFilter
will only get one cell, but i want to get all family data. My goal is to filter out the row data with the value I defined.
On, it's my fault. I have missed the base64 encode.For 'filter', the lib hbase
will encode the follwing params, and others should be encode by ourselves.
if (k === 'value' && (!obj['type'] || obj['type'] !== 'RegexStringComparator' && obj['type'] !== 'PageFilter')) { results.push(obj[k] = utils.base64.encode(obj[k], encoding)); }