rafi-kamal commented on a change in pull request #12089:
URL: https://github.com/apache/beam/pull/12089#discussion_r450590468
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/BigtableIO.java
##########
@@ -410,13 +417,22 @@ public Read withKeyRange(ByteKeyRange keyRange) {
*
* <p>Does not modify this object.
*/
- public Read withKeyRanges(List<ByteKeyRange> keyRanges) {
+ public Read withKeyRanges(ValueProvider<List<ByteKeyRange>> keyRanges) {
checkArgument(keyRanges != null, "keyRanges can not be null");
- checkArgument(!keyRanges.isEmpty(), "keyRanges can not be empty");
- for (ByteKeyRange range : keyRanges) {
- checkArgument(range != null, "keyRanges cannot hold null range");
- }
- return toBuilder().setKeyRanges(keyRanges).build();
+ BigtableReadOptions bigtableReadOptions = getBigtableReadOptions();
+ return toBuilder()
+
.setBigtableReadOptions(bigtableReadOptions.toBuilder().setKeyRanges(keyRanges).build())
+ .build();
+ }
+
+ /**
+ * Returns a new {@link BigtableIO.Read} that will read only rows in the
specified ranges.
+ * Ranges must not overlap.
Review comment:
Agreed - personally I would prefer option 2. I think it's out of scope
for this PR, though, but I'll be happy to do it as a follow-up. Do you know if
there is already a JIRA issue for this?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]