Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(cherry-pick)Refactor key coder for Samza portable runner (#27095) #99

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,11 @@ private static <InT, OutT> void doTranslatePortable(

final RunnerApi.PCollection input = pipeline.getComponents().getPcollectionsOrThrow(inputId);
final PCollection.IsBounded isBounded = SamzaPipelineTranslatorUtils.isBounded(input);
final Coder<?> keyCoder =
StateUtils.isStateful(stagePayload)

// No key coder information required for handing the stateless stage or stage with user states
// The key coder information is required for handing the stage with user timers
final Coder<?> timerKeyCoder =
stagePayload.getTimersCount() > 0
? ((KvCoder)
((WindowedValue.FullWindowedValueCoder) windowedInputCoder).getValueCoder())
.getKeyCoder()
Expand All @@ -325,7 +328,7 @@ private static <InT, OutT> void doTranslatePortable(
new DoFnOp<>(
mainOutputTag,
new NoOpDoFn<>(),
keyCoder,
timerKeyCoder,
windowedInputCoder.getValueCoder(), // input coder not in use
windowedInputCoder,
Collections.emptyMap(), // output coders not in use
Expand Down