Class TableRowToStorageApiProto


  • public class TableRowToStorageApiProto
    extends java.lang.Object
    Utility methods for converting JSON TableRow objects to dynamic protocol message, for use with the Storage write API.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.google.protobuf.Descriptors.Descriptor getDescriptorFromTableSchema​(com.google.api.services.bigquery.model.TableSchema jsonSchema, boolean respectRequired)  
      static com.google.protobuf.Descriptors.Descriptor getDescriptorFromTableSchema​(com.google.cloud.bigquery.storage.v1.TableSchema tableSchema, boolean respectRequired)
      Given a BigQuery TableSchema, returns a protocol-buffer Descriptor that can be used to write data using the BigQuery Storage API.
      static java.lang.Object jsonValueFromMessageValue​(com.google.protobuf.Descriptors.FieldDescriptor fieldDescriptor, java.lang.Object fieldValue, boolean expandRepeated)  
      static com.google.protobuf.DynamicMessage messageFromMap​(org.apache.beam.sdk.io.gcp.bigquery.TableRowToStorageApiProto.SchemaInformation schemaInformation, com.google.protobuf.Descriptors.Descriptor descriptor, java.util.AbstractMap<java.lang.String,​java.lang.Object> map, boolean ignoreUnknownValues)  
      static com.google.protobuf.DynamicMessage messageFromTableRow​(org.apache.beam.sdk.io.gcp.bigquery.TableRowToStorageApiProto.SchemaInformation schemaInformation, com.google.protobuf.Descriptors.Descriptor descriptor, com.google.api.services.bigquery.model.TableRow tableRow, boolean ignoreUnknownValues)
      Given a BigQuery TableRow, returns a protocol-buffer message that can be used to write data using the BigQuery Storage API.
      static com.google.cloud.bigquery.storage.v1.TableFieldSchema.Mode modeToProtoMode​(java.lang.String mode)  
      static java.lang.String protoModeToJsonMode​(com.google.cloud.bigquery.storage.v1.TableFieldSchema.Mode protoMode)  
      static com.google.api.services.bigquery.model.TableSchema protoSchemaToTableSchema​(com.google.cloud.bigquery.storage.v1.TableSchema protoTableSchema)  
      static com.google.api.services.bigquery.model.TableFieldSchema protoTableFieldToTableField​(com.google.cloud.bigquery.storage.v1.TableFieldSchema protoTableField)  
      static java.lang.String protoTypeToJsonType​(com.google.cloud.bigquery.storage.v1.TableFieldSchema.Type protoType)  
      static com.google.cloud.bigquery.storage.v1.TableSchema schemaToProtoTableSchema​(com.google.api.services.bigquery.model.TableSchema tableSchema)  
      static com.google.cloud.bigquery.storage.v1.TableFieldSchema tableFieldToProtoTableField​(com.google.api.services.bigquery.model.TableFieldSchema field)  
      static com.google.api.services.bigquery.model.TableRow tableRowFromMessage​(com.google.protobuf.Message message)  
      static com.google.cloud.bigquery.storage.v1.TableFieldSchema.Type typeToProtoType​(java.lang.String type)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TableRowToStorageApiProto

        public TableRowToStorageApiProto()
    • Method Detail

      • modeToProtoMode

        public static com.google.cloud.bigquery.storage.v1.TableFieldSchema.Mode modeToProtoMode​(java.lang.String mode)
      • protoModeToJsonMode

        public static java.lang.String protoModeToJsonMode​(com.google.cloud.bigquery.storage.v1.TableFieldSchema.Mode protoMode)
      • protoTypeToJsonType

        public static java.lang.String protoTypeToJsonType​(com.google.cloud.bigquery.storage.v1.TableFieldSchema.Type protoType)
      • typeToProtoType

        public static com.google.cloud.bigquery.storage.v1.TableFieldSchema.Type typeToProtoType​(java.lang.String type)
      • protoSchemaToTableSchema

        public static com.google.api.services.bigquery.model.TableSchema protoSchemaToTableSchema​(com.google.cloud.bigquery.storage.v1.TableSchema protoTableSchema)
      • protoTableFieldToTableField

        public static com.google.api.services.bigquery.model.TableFieldSchema protoTableFieldToTableField​(com.google.cloud.bigquery.storage.v1.TableFieldSchema protoTableField)
      • schemaToProtoTableSchema

        public static com.google.cloud.bigquery.storage.v1.TableSchema schemaToProtoTableSchema​(com.google.api.services.bigquery.model.TableSchema tableSchema)
      • tableFieldToProtoTableField

        public static com.google.cloud.bigquery.storage.v1.TableFieldSchema tableFieldToProtoTableField​(com.google.api.services.bigquery.model.TableFieldSchema field)
      • getDescriptorFromTableSchema

        public static com.google.protobuf.Descriptors.Descriptor getDescriptorFromTableSchema​(com.google.api.services.bigquery.model.TableSchema jsonSchema,
                                                                                              boolean respectRequired)
                                                                                       throws com.google.protobuf.Descriptors.DescriptorValidationException
        Throws:
        com.google.protobuf.Descriptors.DescriptorValidationException
      • getDescriptorFromTableSchema

        public static com.google.protobuf.Descriptors.Descriptor getDescriptorFromTableSchema​(com.google.cloud.bigquery.storage.v1.TableSchema tableSchema,
                                                                                              boolean respectRequired)
                                                                                       throws com.google.protobuf.Descriptors.DescriptorValidationException
        Given a BigQuery TableSchema, returns a protocol-buffer Descriptor that can be used to write data using the BigQuery Storage API.
        Throws:
        com.google.protobuf.Descriptors.DescriptorValidationException
      • messageFromTableRow

        public static com.google.protobuf.DynamicMessage messageFromTableRow​(org.apache.beam.sdk.io.gcp.bigquery.TableRowToStorageApiProto.SchemaInformation schemaInformation,
                                                                             com.google.protobuf.Descriptors.Descriptor descriptor,
                                                                             com.google.api.services.bigquery.model.TableRow tableRow,
                                                                             boolean ignoreUnknownValues)
                                                                      throws TableRowToStorageApiProto.SchemaConversionException
        Given a BigQuery TableRow, returns a protocol-buffer message that can be used to write data using the BigQuery Storage API.
        Throws:
        TableRowToStorageApiProto.SchemaConversionException
      • tableRowFromMessage

        public static com.google.api.services.bigquery.model.TableRow tableRowFromMessage​(com.google.protobuf.Message message)
      • jsonValueFromMessageValue

        public static java.lang.Object jsonValueFromMessageValue​(com.google.protobuf.Descriptors.FieldDescriptor fieldDescriptor,
                                                                 java.lang.Object fieldValue,
                                                                 boolean expandRepeated)