|
24 | 24 | import com.google.protobuf.Message; |
25 | 25 | import org.apache.avro.Schema; |
26 | 26 | import org.apache.avro.generic.GenericRecord; |
27 | | -import org.apache.beam.sdk.extensions.avro.schemas.utils.AvroUtils; |
28 | 27 | import org.apache.beam.sdk.io.gcp.bigquery.BigQueryServices.DatasetService; |
29 | 28 | import org.apache.beam.sdk.transforms.SerializableFunction; |
30 | 29 | import org.checkerframework.checker.nullness.qual.NonNull; |
@@ -63,13 +62,11 @@ class GenericRecordConverter implements MessageConverter<T> { |
63 | 62 |
|
64 | 63 | final com.google.cloud.bigquery.storage.v1.TableSchema protoTableSchema; |
65 | 64 | final Schema avroSchema; |
66 | | - final TableSchema bqTableSchema; |
67 | 65 | final Descriptor descriptor; |
68 | 66 | final @javax.annotation.Nullable Descriptor cdcDescriptor; |
69 | 67 |
|
70 | 68 | GenericRecordConverter(DestinationT destination) throws Exception { |
71 | 69 | avroSchema = schemaFactory.apply(getSchema(destination)); |
72 | | - bqTableSchema = BigQueryUtils.toTableSchema(AvroUtils.toBeamSchema(avroSchema)); |
73 | 70 | protoTableSchema = |
74 | 71 | AvroGenericRecordToStorageApiProto.protoTableSchemaFromAvroSchema(avroSchema); |
75 | 72 | descriptor = |
@@ -112,7 +109,7 @@ public TableRow toFailsafeTableRow(T element) { |
112 | 109 | return formatRecordOnFailureFunction.apply(null, element); |
113 | 110 | } else { |
114 | 111 | return BigQueryUtils.convertGenericRecordToTableRow( |
115 | | - toGenericRecord.apply(new AvroWriteRequest<>(element, avroSchema)), bqTableSchema); |
| 112 | + toGenericRecord.apply(new AvroWriteRequest<>(element, avroSchema))); |
116 | 113 | } |
117 | 114 | } |
118 | 115 |
|
|
0 commit comments