Gaurav598 commented on issue #18350:
URL: https://github.com/apache/beam/issues/18350#issuecomment-5471309357

   Hi @kennknowles @damccorm , I investigated the current implementation of 
`WithTimestamps` and `Create.TimestampedValues` to understand the safest way to 
address this issue.
   
   The duplication is still present: both `AddTimestampsDoFn` and 
`ConvertTimestamps` ultimately emit a value using `outputWithTimestamp(...)`. 
However, the surrounding behavior differs in important ways.
   
   In particular, implementing `TimestampedValues` directly as `Create.Values + 
WithTimestamps` does not appear to be a safe refactor. The timestamp is not 
necessarily a function of `T`, so equal/duplicate values can legitimately have 
different timestamps. Preserving that would require keeping 
`TimestampedValue<T>` as an intermediate representation and then unwrapping it, 
which would add another transform/`ParDo` and change the current pipeline graph.
   
   I also found that `TimestampedValues` was previously related to 
`Create.Values` through inheritance, but that was intentionally changed because 
it caused runner matching issues. So I don't think reintroducing that 
relationship would be appropriate.
   
   My current understanding is that the safest approach is a small 
internal/package-private abstraction for the common timestamp-output behavior, 
while preserving the existing `Create.TimestampedValues` execution path, coder 
handling, transform structure, and `WithTimestamps` skew semantics.
   
   I would be happy to implement this approach if that direction looks 
reasonable.
   
   .take-issue
   


-- 
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]

Reply via email to