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

Reply via email to