From f2b88e9c970f381c0afc768c5d5a0c411747209e Mon Sep 17 00:00:00 2001 From: lostluck <13907733+lostluck@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:51:14 -0800 Subject: [PATCH] Force portable TestStream to use NesteCoder context throughout. --- .../beam/sdk/util/construction/TestStreamTranslation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/TestStreamTranslation.java b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/TestStreamTranslation.java index 154c3c87a1ce..412ea9aea2ce 100644 --- a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/TestStreamTranslation.java +++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/TestStreamTranslation.java @@ -123,7 +123,7 @@ static RunnerApi.TestStreamPayload.Event eventToProto( .setTimestamp(element.getTimestamp().getMillis()) .setEncodedElement( ByteString.copyFrom( - CoderUtils.encodeToByteArray(coder, element.getValue())))); + CoderUtils.encodeToByteArray(coder, element.getValue(), Coder.Context.NESTED)))); } return RunnerApi.TestStreamPayload.Event.newBuilder().setElementEvent(builder).build(); default: @@ -149,7 +149,7 @@ static TestStream.Event eventFromProto( protoEvent.getElementEvent().getElementsList()) { decodedElements.add( TimestampedValue.of( - CoderUtils.decodeFromByteArray(coder, element.getEncodedElement().toByteArray()), + CoderUtils.decodeFromByteArray(coder, element.getEncodedElement().toByteArray(), Coder.Context.NESTED), new Instant(element.getTimestamp()))); } return TestStream.ElementEvent.add(decodedElements);