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

The read_rows method in the bigtable client does not provide an interface to specify open/closed key ranges #3592

Closed
jdmargulici opened this issue Jul 6, 2017 · 1 comment
Assignees
Labels
api: bigtable Issues related to the Bigtable API. priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@jdmargulici
Copy link

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.

@dhermes dhermes added the api: bigtable Issues related to the Bigtable API. label Jul 6, 2017
@robertlacok
Copy link

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?

Let me know, if it's good, I can pick it up.

@lukesneeringer lukesneeringer self-assigned this Aug 7, 2017
@lukesneeringer lukesneeringer added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Aug 7, 2017
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 Bigtable API. priority: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

No branches or pull requests

4 participants