shunping commented on code in PR #31092:
URL: https://github.com/apache/beam/pull/31092#discussion_r1586453290
##########
model/fn-execution/src/main/proto/org/apache/beam/model/fn_execution/v1/beam_fn_api.proto:
##########
@@ -1063,6 +1087,10 @@ message StateAppendRequest {
// Represents a part of a logical byte stream. Elements within
// the logical byte stream are encoded in the nested context and
// multiple append requests are concatenated together.
+ // For OrderedListState, elements of TimeStampedValue<T> should be encoded
+ // with TimestampedValueCoder.of(LengthPrefixCoder.of(Coder<T>)), so that
+ // the request handler knows how to decode timestamps from the data without
Review Comment:
This sounds a bit not counter-intuitive, but the coder of `TimestampedValue`
is not equivalent to that of `KV<VarInt64, LP<value>>`. Particularly,
`TimestampedValueCoder` encodes/decodes the *value* first and then *timestamp*.
https://github.com/apache/beam/blob/413af1289373079319ba77b3f233751fbdfc3bc9/sdks/java/core/src/main/java/org/apache/beam/sdk/values/TimestampedValue.java#L110-L111
But `KV<VarInt64, LP<value>>` does that in the opposite order. In order to
maintain the compatibility of these two coders and make the implementation
simpler, how about we explicitly define the use of `KV<LP<value>, VarInt64>>`
coder instead?
@robertwb
--
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]