reuvenlax commented on code in PR #27866:
URL: https://github.com/apache/beam/pull/27866#discussion_r1286536387


##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java:
##########
@@ -2170,6 +2174,27 @@ public static Write<GenericRecord> writeGenericRecords() 
{
         .withAvroFormatFunction(GENERIC_RECORD_IDENTITY_FORMATTER);
   }
 
+  /**
+   * A {@link PTransform} that writes a {@link PCollection} containing 
protocol buffer objects to a
+   * BigQuery table. If using one of the storage-api write methods, these 
protocol buffers must
+   * match the schema of the table.
+   *
+   * <p>If a Schema is provided using {@link Write#withSchema}, that schema 
will be used for
+   * creating the table if necessary. If no schema is provided, one will be 
inferred from the
+   * protocol buffer's descriptor. Note that inferring a schema from the 
protocol buffer may not
+   * always provide the intended schema as multiple BigQuery types can map to 
the same protocol
+   * buffer type. For example, a protocol buffer field of type INT64 may be an 
INT64 BigQuery type,
+   * but it might also represent a TIME, DATETIME, or a TIMESTAMP type.
+   */
+  public static <T extends Message> Write<T> writeProtos(Class<T> 
protoMessageClass) {

Review Comment:
   Not sure I understand - We already have <T extends Message> in the type 
bounds here.



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

Reply via email to