I need a scan limited to one column family only.
I want to do something like this:
var scan = client.getScanner(topicTokens.table),
var f = {
familyFilter: {
compareFilter: {
compareOp: 'EQUAL',
comparator: {
substringComparator: {
substr: topicTokens.family
}
}
}
}
};
scan.setFilter(f);
But this gives me invalid field exceptions. I have to do something like this:
var scan = client.getScanner(topicTokens.table),
//singleColumnValueFilter is treated as special in scan.js so we have to
//use it to serialize the comparator (we can't do it directly).
var dummy = {
singleColumnValueFilter: {
compareOp: "EQUAL",
comparator: {
substringComparator: {
substr: topicTokens.family
}
}
}
}
scan.setFilter(dummy);
var f = {
familyFilter: {
compareFilter: {
compareOp: 'EQUAL',
comparator: dummy.singleColumnValueFilter.comparator
}
}
};
scan.setFilter(f);
I am not sure if I have missed another way of doing this. If so, I'd like to know how please.
The serialisation could be fixed to do this as in my first example, or you could expose scan.getFilter() and allow me to serialise it by hand. I wasn't sure of the rational behind making singleColumnValueFilter a special case.
I need a scan limited to one column family only.
I want to do something like this:
But this gives me invalid field exceptions. I have to do something like this:
I am not sure if I have missed another way of doing this. If so, I'd like to know how please.
The serialisation could be fixed to do this as in my first example, or you could expose scan.getFilter() and allow me to serialise it by hand. I wasn't sure of the rational behind making singleColumnValueFilter a special case.