Skip to content

Commit

Permalink
[BEAM-12384] Infer typeDescriptor from coder if typeDescriptor is not…
Browse files Browse the repository at this point in the history
… set explicitly.
  • Loading branch information
Boyuan Zhang authored and iemejia committed May 26, 2021
1 parent 3b705c1 commit 83bccf9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ public void finishSpecifying(PInput input, PTransform<?, ?> transform) {
* override this to enable better {@code Coder} inference.
*/
public @Nullable TypeDescriptor<T> getTypeDescriptor() {
return typeDescriptor;
if (typeDescriptor != null) {
return typeDescriptor;
}
if (coderOrFailure.coder != null) {
return coderOrFailure.coder.getEncodedTypeDescriptor();
}
return null;
}

/**
Expand Down

0 comments on commit 83bccf9

Please sign in to comment.