googleapis / java-bigtable

Apache License 2.0
71 stars 86 forks source link

Incorrect documentation on regex string comparator about not supporting flags #239

Open PragyaTripathi opened 4 years ago

PragyaTripathi commented 4 years ago

While comparing HBase and Bigtable and outlining what can be supported, the documentation outlined here: https://cloud.google.com/bigtable/docs/hbase-differences#filters says that BigTable

Supports only the following comparators: RegexStringComparator with no flags and the EQUAL operator

It is possible to set case insensitivity flag using regex function in the library by setting RE2 flag for case insensitive search. (?i)

kolea2 commented 4 years ago

Hi @PragyaTripathi! Are you using the Bigtable Java client or the Bigtable Hbase Java client? If you are using the Bigtable Java client, you can achieve that using a regex filter. Here's an example for a row key:

Filters.Filter filter = FILTERS.key().regex("(?i)rowkey.*");

You can find more filter examples here: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/bigtable/snippets/src/main/java/com/example/bigtable/Filters.java

Hope that helps!

PragyaTripathi commented 4 years ago

Hi @kolea2, I am well aware of it. I was just pointing out that the documentation is incorrect.

rahulKQL commented 4 years ago

Hi @PragyaTripathi,

The flag in difference's documentation refers to RegexStringComparater's constructor param. In case a user sets this param(eg. new RegexStringComparator("a.*", Pattern.CASE_INSENSITIVE)) the Bigtable HBase client ignores the flag.

kolea2 commented 4 years ago

@PragyaTripathi apologies, I misread your initial post - got it, thank you for filing this!

@cshaff0524 is this something you could take a look at? Edit: looking at Rahul's comment, perhaps we could mention this

cshaff0524 commented 4 years ago

Yes, I'll create a docs bug for this. Thanks for the heads up!