Class UpgradeTableSchema
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.bigquery.UpgradeTableSchema
-
public class UpgradeTableSchema extends java.lang.ObjectHelper functions for SchemaUpdateOptions.
-
-
Constructor Summary
Constructors Constructor Description UpgradeTableSchema()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.cloud.bigquery.storage.v1.TableSchemagetIncrementalSchema(TableRowToStorageApiProto.ErrorCollector errorCollector, com.google.cloud.bigquery.storage.v1.TableSchema oldSchema)Given a list of schema errors, generate a new schema that represents the minimal changes needed to the schema in order to validate the new record.static booleanisPayloadSchemaOutOfDate(StorageApiWritePayload payload, org.apache.beam.sdk.util.ThrowingSupplier<byte[]> schemaHash, org.apache.beam.sdk.util.ThrowingSupplier<com.google.protobuf.Descriptors.Descriptor> schemaDescriptor)static com.google.cloud.bigquery.storage.v1.TableSchemamergeSchemas(com.google.cloud.bigquery.storage.v1.TableSchema schema1, com.google.cloud.bigquery.storage.v1.TableSchema schema2)static TableRowToStorageApiProto.ErrorCollectornewErrorCollector()
-
-
-
Method Detail
-
newErrorCollector
public static TableRowToStorageApiProto.ErrorCollector newErrorCollector()
-
getIncrementalSchema
public static com.google.cloud.bigquery.storage.v1.TableSchema getIncrementalSchema(TableRowToStorageApiProto.ErrorCollector errorCollector, com.google.cloud.bigquery.storage.v1.TableSchema oldSchema) throws TableRowToStorageApiProto.SchemaDoesntMatchException
Given a list of schema errors, generate a new schema that represents the minimal changes needed to the schema in order to validate the new record. We only generate the incremental schema here for performance reasons, as these schemas will be shuffled. The final transform will merge this back into the existing table schema before updating the table.
-
mergeSchemas
public static com.google.cloud.bigquery.storage.v1.TableSchema mergeSchemas(com.google.cloud.bigquery.storage.v1.TableSchema schema1, com.google.cloud.bigquery.storage.v1.TableSchema schema2)
-
isPayloadSchemaOutOfDate
public static boolean isPayloadSchemaOutOfDate(StorageApiWritePayload payload, org.apache.beam.sdk.util.ThrowingSupplier<byte[]> schemaHash, org.apache.beam.sdk.util.ThrowingSupplier<com.google.protobuf.Descriptors.Descriptor> schemaDescriptor) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-