The read_rows method in the bigtable client does not provide an interface to specify open/closed key ranges #3592
Labels
api: bigtable
Issues related to the Bigtable API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
The read_rows method of the Table class in the bigtable client is designed such that the results are inclusive of the start key but exclusive of the end key. That seems a reasonable choice, until one considers that keys may be designed to accumulate in reverse order (as recommended in the docs: https://cloud.google.com/bigtable/docs/schema-design-time-series). In that case, it is necessary to flip the natural order of the keys to process a query -i.e. if I query from time t0 to t1, I will create two corresponding keys k0 and k1, but k1 will be the start key and k0 the end key in the call to read_rows.
Currently, the specification of open and closed for the start and end key is hard-coded in the _create_row_request method, and that makes it difficult for an end user of the library to alter the default behavior. Consider adding an option to the read_rows method, or better yet, an attribute of a Table instance, such that queries can implement different behaviors with respect to the start and end keys.
The text was updated successfully, but these errors were encountered: