You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Nicolas Spiegelberg (Resolved) (JIRA)" <ji...@apache.org> on 2012/01/18 04:09:43 UTC

[jira] [Resolved] (HBASE-5126) AND (USING FilterList) of two ColumnPrefixFilters broken

     [ https://issues.apache.org/jira/browse/HBASE-5126?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Spiegelberg resolved HBASE-5126.
----------------------------------------

    Resolution: Not A Problem

not a problem in trunk, only 89-fb
                
> AND (USING FilterList) of two ColumnPrefixFilters broken
> --------------------------------------------------------
>
>                 Key: HBASE-5126
>                 URL: https://issues.apache.org/jira/browse/HBASE-5126
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Kannan Muthukkaruppan
>            Assignee: Madhuwanti Vaidya
>         Attachments: testAndTwoPrefixFilters.rb, testAndTwoPrefixFilters.rb
>
>
> [Notice this in 89 branch. Possibly an issue in trunk also.]
> A test which does a columnPrefixFilter("tag0") AND columnPrefixFilter("tag1") should return 0 kvs; instead it returns kvs with prefix "tag0".
> {code}
> table = HTable.new(conf, tableName)
> put = Put.new(Bytes.toBytes("row"))
> put.add(cf1name, Bytes.toBytes("tag0"), Bytes.toBytes("value0"))
> put.add(cf1name, Bytes.toBytes("tag1"), Bytes.toBytes("value1"))
> put.add(cf1name, Bytes.toBytes("tag2"), Bytes.toBytes("value2"))
> table.put(put)
> # Test for AND Two Column Prefix Filters                                                                                                                                                   
> filter1 = ColumnPrefixFilter.new(Bytes.toBytes("tag0"));
> filter2 = ColumnPrefixFilter.new(Bytes.toBytes("tag2"));
> filters = FilterList.new(FilterList::Operator::MUST_PASS_ALL);
> filters.addFilter(filter1);
> filters.addFilter(filter2);
> get = Get.new(Bytes.toBytes("row"))
> get.setFilter(filters)
> get.setMaxVersions();
> keyValues = table.get(get).raw()
> keyValues.each do |keyValue|
>   puts "Key=#{Bytes.toStringBinary(keyValue.getQualifier())}; Value=#{Bytes.toStringBinary(keyValue.getValue())}; Timestamp=#{keyValue.getTimestamp()}" 
> end
> {code}
> outputs:
> {code}
> Key=tag0; Value=value0; Timestamp=1325719223523
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira