[
https://issues.apache.org/jira/browse/BEAM-12164?focusedWorklogId=742935&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-742935
]
ASF GitHub Bot logged work on BEAM-12164:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 17/Mar/22 03:08
Start Date: 17/Mar/22 03:08
Worklog Time Spent: 10m
Work Description: thiagotnunes commented on a change in pull request
#17023:
URL: https://github.com/apache/beam/pull/17023#discussion_r828716251
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/dofn/DetectNewPartitionsDoFn.java
##########
@@ -109,9 +110,7 @@ public Instant getInitialWatermarkEstimatorState(@Element
PartitionMetadata part
public TimestampRange initialRestriction(@Element PartitionMetadata
partition) {
final com.google.cloud.Timestamp createdAt = partition.getCreatedAt();
return TimestampRange.of(
- com.google.cloud.Timestamp.ofTimeSecondsAndNanos(
- createdAt.getSeconds(), createdAt.getNanos() - 1),
- com.google.cloud.Timestamp.MAX_VALUE);
+ TimestampUtils.previous(createdAt),
com.google.cloud.Timestamp.MAX_VALUE);
Review comment:
Makes sure there is no underflow here by using `TimestampUtils.previous`
instead of simply subtracting `1ns`
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/dofn/ReadChangeStreamPartitionDoFn.java
##########
@@ -130,8 +130,7 @@ public TimestampRange initialRestriction(@Element
PartitionMetadata partition) {
final com.google.cloud.Timestamp startTimestamp =
partition.getStartTimestamp();
// Range represents closed-open interval
final com.google.cloud.Timestamp endTimestamp =
- ofTimeSecondsAndNanos(
- partition.getEndTimestamp().getSeconds(),
partition.getEndTimestamp().getNanos() + 1);
+ TimestampUtils.next(partition.getEndTimestamp());
Review comment:
Makes sure there is no overflow here by using `TimestampUtils.next`
instead of simply adding `1ns`
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 742935)
Time Spent: 53h 20m (was: 53h 10m)
> SpannerIO Change Stream Connector
> ---------------------------------
>
> Key: BEAM-12164
> URL: https://issues.apache.org/jira/browse/BEAM-12164
> Project: Beam
> Issue Type: New Feature
> Components: sdk-java-core
> Reporter: Thiago Nunes
> Assignee: Thiago Nunes
> Priority: P2
> Fix For: 2.37.0
>
> Time Spent: 53h 20m
> Remaining Estimate: 0h
>
> We would like to augment the existing Google Cloud SpannerIO connector
> ([https://github.com/apache/beam/blob/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/SpannerIO.java)]
> with the support for Spanner Change Streams (CDC). CDC support is just being
> implemented in Spanner and it will be exposed through a gRPC API. We will use
> such API to create a new SpannerIO.readChangeStream(...) implementation.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)