Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FuzzyRowFilterAdapter is missing from FilterAdapter #616

Closed
ZubairNabi opened this issue Dec 29, 2015 · 5 comments · Fixed by #832
Closed

FuzzyRowFilterAdapter is missing from FilterAdapter #616

ZubairNabi opened this issue Dec 29, 2015 · 5 comments · Fixed by #832
Assignees
Labels
api: bigtable Issues related to the googleapis/java-bigtable-hbase API.

Comments

@ZubairNabi
Copy link

I've been trying to get FuzzyRowFilter to work, but out of the box I get the following exception:

Caused by: com.google.cloud.bigtable.hbase.adapters.filters.UnsupportedFilterException: Unsupported filters encountered: FilterSupportStatus{isSupported=false, reason='Don't know how to adapt Filter class 'class org.apache.hadoop.hbase.filter.FuzzyRowFilter''}

I can see that there's an adapter for it in the codebase but it's not in the filter map within FileAdapter. Putting it in the map causes the previous exception to obviously go away but then I get a dependency conflict:

Caused by: java.lang.NoSuchMethodError: org.apache.hadoop.hbase.protobuf.generated.HBaseProtos$BytesBytesPair.getFirst()Lcom/google/bigtable/repackaged/com/google/protobuf/ByteString;
    at com.google.cloud.bigtable.hbase.adapters.filters.FuzzyRowFilterAdapter.extractFuzzyRowFilterPairs(FuzzyRowFilterAdapter.java:90)
    at com.google.cloud.bigtable.hbase.adapters.filters.FuzzyRowFilterAdapter.adapt(FuzzyRowFilterAdapter.java:48)
    at com.google.cloud.bigtable.hbase.adapters.filters.FuzzyRowFilterAdapter.adapt(FuzzyRowFilterAdapter.java:39)
    at com.google.cloud.bigtable.hbase.adapters.filters.SingleFilterAdapter.adapt(SingleFilterAdapter.java:56)
    at com.google.cloud.bigtable.hbase.adapters.filters.FilterAdapter.adaptFilter(FilterAdapter.java:143)
    at com.google.cloud.bigtable.hbase.adapters.ScanAdapter.createUserFilter(ScanAdapter.java:116)
    at com.google.cloud.bigtable.hbase.adapters.ScanAdapter.buildFilter(ScanAdapter.java:77)
    at com.google.cloud.bigtable.hbase.adapters.ScanAdapter.adapt(ScanAdapter.java:94)
    at com.google.cloud.bigtable.hbase.adapters.HBaseRequestAdapter.adapt(HBaseRequestAdapter.java:70)
    at com.google.cloud.bigtable.hbase.BigtableTable.getScanner(BigtableTable.java:206)

This seems to be a subtle dependency issue due to the mismatch between protobuf versions used by HBase and BigTable but all shading attempts on my part have been futile so far. Any idea how I can side-step this issue?

@sduskis
Copy link
Contributor

sduskis commented Dec 29, 2015

The dependency mismatch issue strikes again. I'm going to have to mull over this one. I'll see what I can do about this, since it's a bit tricky. Perhaps we can use reflection instead of the FuzzyRowFilter proto conversion to get the fuzzyKeysData. I'm not sure that I can fix this problem this week, given the short week, but I'll work on this as a high priority issue and hopefully submit a PR next week.

@sduskis sduskis self-assigned this Dec 29, 2015
@sduskis
Copy link
Contributor

sduskis commented Dec 30, 2015

There are quite a few issues with our current implementation of the FuzzyRowFilterAdapter. Even once I fix the bugs, we won't be able to easily completely replicate the HBase FuzzyRowFilter implementation. HBase will allow some cases that we won't; specifically, if the row size is smaller than the keys supplied to the filter. In the meantime, you can use a FilterList of RowFilter with RegexStringComparator.

@ZubairNabi
Copy link
Author

Thanks for looking into this.
And yes, I've gone ahead and replaced my FuzzyRowFilter with a RegexStringComparator based approach.

@sduskis
Copy link
Contributor

sduskis commented Feb 2, 2016

I still didn't get to this. This will have to come in the next release.

@manolama
Copy link
Contributor

manolama commented Mar 1, 2016

+1 on this guy as I just learned how wonderfully useful this filter is.

sduskis added a commit to sduskis/cloud-bigtable-client that referenced this issue Mar 28, 2016
FuzzyRowFilterAdapter has a couple of problems:

1) It uses the hbase proto conversion to get the "fuzzyKeysDataList."  That conversion doesn't work when our shading is combined with non-shaded hbase.  Things just don't work.
2) The data and mask were switched in the adapter.  see https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java#L80 for more info.

This is the first step towards fixing googleapis#616.
sduskis added a commit to sduskis/cloud-bigtable-client that referenced this issue Mar 28, 2016
FuzzyRowFilterAdapter has a couple of problems:

1) It uses the hbase proto conversion to get the "fuzzyKeysDataList."  That conversion doesn't work when our shading is combined with non-shaded hbase.  Things just don't work.
2) The data and mask were switched in the adapter.  see https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/FuzzyRowFilter.java#L80 for more info.

This is the first step towards fixing googleapis#616.
@google-cloud-label-sync google-cloud-label-sync bot added the api: bigtable Issues related to the googleapis/java-bigtable-hbase API. label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/java-bigtable-hbase API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants