googleapis / java-bigtable-hbase

Java libraries and HBase client extensions for accessing Google Cloud Bigtable
https://cloud.google.com/bigtable/
Apache License 2.0
174 stars 178 forks source link

fix: align the handling of regular expressions between hbase & bigtable #4430

Closed igorbernstein2 closed 1 month ago

igorbernstein2 commented 1 month ago

When using RegexStringComparator, HBase will try to match a substring of the target. While bigtable requires a full match. For example, given the target "abcd", in HBase the regex "[bc]*" will match the string. However Bigtable will not. Bigtable will require the regex to also match a & d.

This PR addresses this discrepancy by surrounding the user provided regex with a zero or more wildcards. ie transform "[bc]*" into ".*[bc]*.*"

Change-Id: I7404bddd4c9c9d907d57225d99f7062c4407fc35

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

Fixes # ☕️

If you write sample code, please follow the samples format.