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

feat: add experimental support for reverse scans public preview #1708

Closed
wants to merge 2 commits into from

Conversation

igorbernstein2
Copy link
Contributor

@igorbernstein2 igorbernstein2 commented Apr 13, 2023

This adds a reversed boolean to Query, which will allow endusers to stream rows in reverse order.

Example:

Query query = Query.create("alphabet").range("a", "z").limit(3);
ServerStream<Row> results = client.readRows(query);

for (Row row : results) {
  System.out.println(row.getKey().toStringUtf8());
}
// Prints z, y, x

This its currently blocked on generated protos which will be autogenerated soon

Change-Id: I092f236658a93a8ebd0bbc3bf1ef83c5c4978432
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigtable Issues related to the googleapis/java-bigtable API. labels Apr 13, 2023
Change-Id: I1f965e0f43fd3713a7abfff68466be7c861d08a7
.limit(2)
.prefix("phone#4c410523")
.range(ByteStringRange.unbounded()
.startClosed("phone#5c10102")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startClosed and end closed is the same key, maybe change to different keys? So customers can know if start key should be < end key or > end key because it's reversed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe in the javadoc example in Query.java update it to:

   * <pre>{@code
   * query
   *   .range(ByteStringRange.unbounded().startKeyClosed("a").endOpen("c"))
   *   .limit(10)
   *   .reversed(true)
   * }</pre>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the sample to use different keys

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(in #1711)

@igorbernstein2
Copy link
Contributor Author

igorbernstein2 commented Apr 14, 2023

closing in favor of #1711 and will address feedback there

mutianf pushed a commit to mutianf/java-bigtable that referenced this pull request May 3, 2023
Source-Link: googleapis/synthtool@fbc8bfe
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:e76136cc48f90aa19ba29cdfbd4002111467e44a1c9d905867d98dafafbd03bb

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
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 googleapis/java-bigtable API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants