Hi,
I'll try to rephrase the problem...
We have a table where we add an empty value.(The same thing happen also if we have a value). Afterward we put a value inside.(Same put, just other value). When scanning for empty values (first values inserted), the result is wrong because the filter gets called for both values (the empty which maches and the not empty which doesn't match). The table has only one version. It looks like the heap object in StoreScanner has both objects. Do you have any idea if this is a normal behavior and if we can avoid this somehow?

Thank you,
Iulia

On 05/10/2011 03:56 PM, Stefan Comanita wrote:
Hi all,

I want to do a scan on a number of rows, each row having multiple columns, and 
I want to filter out some of this columns based on their values per example, if 
I have the following rows:

plainRow:col:value1 column=T:19, timestamp=19, value= plainRow:col:value1 column=T:2, timestamp=2, value=U plainRow:col:value1 column=T:3, timestamp=3, value=U plainRow:col:value1 column=T:4, timestamp=4, value=

and

secondRow:col:value1 column=T:1, timestamp=1, value= secondRow:col:value1 column=T:2, timestamp=2, value= secondRow:col:value1 column=T:3, timestamp=3, value=U secondRow:col:value1 column=T:4, timestamp=4, value=


and I want to select all the rows but just with the columns that don't have the value 
"U", something like:

plainRow:col:value1 column=T:19, timestamp=19, value= plainRow:col:value1 column=T:4, timestamp=4, value= secondRow:col:value1 column=T:1, timestamp=1, value= secondRow:col:value1 column=T:2, timestamp=2, value= secondRow:col:value1 column=T:4, timestamp=4, value=

and to achieve this, i try the following:

Scan scan = new Scan();
scan.setStartRow(stringToBytes(rowIdentifier));
scan.setStopRow(stringToBytes(rowIdentifier + Constants.MAX_CHAR));
scan.addFamily(Constants.TERM_VECT_COLUMN_FAMILY);

if(includeFilter) {
     Filter filter = new ValueFilter(CompareOp.EQUAL,
new BinaryComparator(stringToBytes("U"))); scan.setFilter(filter);
}

and if i execute this scan I get the rows with the columns having the value "U", which is 
correct, but when i set CompareOp.NOT_EQUAL and i expect to get the other columns it doesnt work 
the way i want, it give me back all the rows, including the one which have the value "U", 
the same happens when i use:
Filter filter = new ValueFilter(CompareOp.EQUAL, new 
BinaryComparator(stringToBytes("")));

I mention that the columns have the values "U" and "" (empty string), and that 
i also saw the same behaivior with the RegexComparator and SubstringComparator.

Any idea would be very much appreciated, sorry for the long mail, thank you.

Stefan Comanita


--
Iulia Zidaru
Java Developer

1&1 Internet AG - Bucharest/Romania - Web Components Romania
18 Mircea Eliade St
Sect 1, Bucharest
RO Bucharest, 012015
[email protected]
0040 31 223 9153

Reply via email to