TheNeuralBit commented on a change in pull request #13980:
URL: https://github.com/apache/beam/pull/13980#discussion_r588497361



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubSchemaIOProvider.java
##########
@@ -206,17 +211,18 @@ public Schema schema() {
       return new PTransform<PBegin, PCollection<Row>>() {
         @Override
         public PCollection<Row> expand(PBegin begin) {
+          PubsubMessageToRow.Builder builder =
+              PubsubMessageToRow.builder()
+                  .messageSchema(dataSchema)
+                  .useDlq(config.useDeadLetterQueue())
+                  .useFlatSchema(useFlatSchema);
+          if (!useFlatSchema && !fieldPresent(schema(), PAYLOAD_FIELD, 
FieldType.BYTES)) {

Review comment:
       Internal tests had a breakage, I think this is the reason:
   ```suggestion
             if (useFlatSchema || !fieldPresent(schema(), PAYLOAD_FIELD, 
FieldType.BYTES)) {
   ```
   
   SQL PostCommit (PubSubTableProviderIT) should exercise this.




----------------------------------------------------------------
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]


Reply via email to