apache / beam

Apache Beam is a unified programming model for Batch and Streaming data processing.
https://beam.apache.org/
Apache License 2.0
7.78k stars 4.21k forks source link

Timestamp value conversion in Cloud Datastore connector is wrong #21660

Closed damccorm closed 2 years ago

damccorm commented 2 years ago

Code in org.apache.beam.sdk.io.gcp.datastore.EntityToRow class:


com.google.protobuf.Timestamp time = val.getTimestampValue();
long millis = time.getSeconds() * 1000
+ time.getNanos() / 1000;
return Instant.ofEpochMilli(millis).toDateTime();

1 millisecond = 1,000,000 nanoseconds

Imported from Jira BEAM-14541. Original Jira may contain additional context. Reported by: yixiaoshen.

damccorm commented 2 years ago

Unable to assign user @yixiaoshen. If able, self-assign, otherwise tag @damccorm so that he can assign you. Because of GitHub's spam prevention system, your activity is required to enable assignment in this repo.

yixiaoshen commented 2 years ago

@damccorm I don't have permission to assign the issue, can you help assign the issue to me? thanks!

damccorm commented 2 years ago

Done - FWIW once https://github.com/apache/beam/pull/21719 is merged, you'll be able to self-assign by commenting .take-issue

yixiaoshen commented 2 years ago

This is fixed by #17789, but I don't seem to have permission to .close-issue

damccorm commented 2 years ago

This is fixed by https://github.com/apache/beam/pull/17789, but I don't seem to have permission to .close-issue

You just did 😃 anyone can do it by commenting .close-issue like you just did