Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.google.protobuf.Message;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericRecord;
import org.apache.beam.sdk.extensions.avro.schemas.utils.AvroUtils;
import org.apache.beam.sdk.io.gcp.bigquery.BigQueryServices.DatasetService;
import org.apache.beam.sdk.transforms.SerializableFunction;
import org.checkerframework.checker.nullness.qual.NonNull;
Expand Down Expand Up @@ -63,13 +62,11 @@ class GenericRecordConverter implements MessageConverter<T> {

final com.google.cloud.bigquery.storage.v1.TableSchema protoTableSchema;
final Schema avroSchema;
final TableSchema bqTableSchema;
final Descriptor descriptor;
final @javax.annotation.Nullable Descriptor cdcDescriptor;

GenericRecordConverter(DestinationT destination) throws Exception {
avroSchema = schemaFactory.apply(getSchema(destination));
bqTableSchema = BigQueryUtils.toTableSchema(AvroUtils.toBeamSchema(avroSchema));
protoTableSchema =
AvroGenericRecordToStorageApiProto.protoTableSchemaFromAvroSchema(avroSchema);
descriptor =
Expand Down Expand Up @@ -112,7 +109,7 @@ public TableRow toFailsafeTableRow(T element) {
return formatRecordOnFailureFunction.apply(null, element);
} else {
return BigQueryUtils.convertGenericRecordToTableRow(
toGenericRecord.apply(new AvroWriteRequest<>(element, avroSchema)), bqTableSchema);
toGenericRecord.apply(new AvroWriteRequest<>(element, avroSchema)));
}
}

Expand Down
Loading