TheNeuralBit commented on a change in pull request #11532:
URL: https://github.com/apache/beam/pull/11532#discussion_r427408368
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java
##########
@@ -1059,7 +1071,12 @@ public SpannerWriteResult
expand(PCollection<MutationGroup> input) {
spec.getBatchSizeBytes(),
spec.getMaxNumMutations(),
spec.getMaxNumRows(),
- spec.getGroupingFactor(),
+ // Do not group on streaming unless explicitly
set.
+ spec.getGroupingFactor()
+ .orElse(
+ input.isBounded() == IsBounded.BOUNDED
+ ? DEFAULT_GROUPING_FACTOR
+ : 1),
Review comment:
It would be nice if this were another constant. We could have
`DEFAULT_GROUPING_FACTOR_BOUNDED` and `DEFAULT_GROUPING_FACTOR_UNBOUNDED`. It
doesn't need to be done here, could be in a follow-up PR.
----------------------------------------------------------------
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]