You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The read_rows method in the bigtable client does not provide an interface to specify open/closed key ranges #3592
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.
I also miss this feature. Would it be sensible to add two more optional arguments to the read_rows method, include_start_key and include_end_key, which default to True and False respectively (current behavior), but they allow setting it manually?
From what I see, that only requires adding a few more if statements here, and some docs, right?
Activity
robertlacok commentedon Jul 12, 2017
I also miss this feature. Would it be sensible to add two more optional arguments to the
read_rowsmethod,include_start_keyandinclude_end_key, which default toTrueandFalserespectively (current behavior), but they allow setting it manually?From what I see, that only requires adding a few more if statements here, and some docs, right?
Let me know, if it's good, I can pick it up.