piotr-szuberski commented on a change in pull request #12780:
URL: https://github.com/apache/beam/pull/12780#discussion_r514070717
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubMessageToRow.java
##########
@@ -175,11 +213,21 @@ public void processElement(
private final boolean useDlq;
+ private final PayloadFormat payloadFormat;
+
private transient volatile @Nullable ObjectMapper objectMapper;
- protected NestedSchemaPubsubMessageToRow(Schema messageSchema, boolean
useDlq) {
+ private final SimpleFunction<byte[], Row> avroBytesToRowFn;
+
+ private final Schema payloadSchema;
+
+ protected NestedSchemaPubsubMessageToRow(
+ Schema messageSchema, boolean useDlq, PayloadFormat payloadFormat) {
this.messageSchema = messageSchema;
this.useDlq = useDlq;
+ this.payloadFormat = payloadFormat;
+ this.payloadSchema =
messageSchema.getField(PAYLOAD_FIELD).getType().getRowSchema();
+ this.avroBytesToRowFn =
AvroUtils.getAvroBytesToRowFunction(payloadSchema);
Review comment:
Done. Indeed it's much clearer now!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]