robertwb commented on code in PR #28782:
URL: https://github.com/apache/beam/pull/28782#discussion_r1358479119
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubReadSchemaTransformProvider.java:
##########
@@ -207,26 +271,47 @@ PubsubIO.Read<PubsubMessage> buildPubsubRead() {
throw new IllegalArgumentException(
"Both PubsubTestClientFactory and Clock need to be specified for
testing, but only one is provided");
}
+ if (!Strings.isNullOrEmpty(configuration.getIdAttribute())) {
+ pubsubRead =
pubsubRead.withIdAttribute(configuration.getIdAttribute());
+ }
+ if (!Strings.isNullOrEmpty(configuration.getTimestampAttribute())) {
+ pubsubRead =
pubsubRead.withTimestampAttribute(configuration.getTimestampAttribute());
+ }
return pubsubRead;
}
@Override
public PCollectionRowTuple expand(PCollectionRowTuple input) {
PubsubIO.Read<PubsubMessage> pubsubRead = buildPubsubRead();
+ @SuppressWarnings("nullness")
Review Comment:
Unfortunately the nullness checker is not smart enough for that.
--
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]