MiguelAnzoWizeline commented on a change in pull request #14586:
URL: https://github.com/apache/beam/pull/14586#discussion_r640275735



##########
File path: 
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/SchemaAndRecord.java
##########
@@ -18,23 +18,32 @@
 package org.apache.beam.sdk.io.gcp.bigquery;
 
 import com.google.api.services.bigquery.model.TableSchema;
+import javax.annotation.Nullable;
 import org.apache.avro.generic.GenericRecord;
+import org.apache.beam.sdk.values.Row;
 
 /**
  * A wrapper for a {@link GenericRecord} and the {@link TableSchema} 
representing the schema of the
  * table (or query) it was generated from.
  */
 public class SchemaAndRecord {
-  private final GenericRecord record;
+  private final Object record;
   private final TableSchema tableSchema;
 
-  public SchemaAndRecord(GenericRecord record, TableSchema tableSchema) {
+  public SchemaAndRecord(Object record, TableSchema tableSchema) {
     this.record = record;
     this.tableSchema = tableSchema;
   }
 
   public GenericRecord getRecord() {
-    return record;
+    if (!(record instanceof GenericRecord)) {
+      throw new IllegalStateException("Object is not GenericRecord");
+    }
+    return (GenericRecord) record;
+  }

Review comment:
       R: @TheNeuralBit Went with option 3, fixed the code to use GenericRecord 
and added the conversion from Row. Checks are passing except java preCommit, 
but appears to be because some flink services are down?, I will try to run the 
check later.




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