public class ProtobufUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ProtobufUtils.ProtobufSchemaFieldCacheEntry |
| Constructor and Description |
|---|
ProtobufUtils() |
| Modifier and Type | Method and Description |
|---|---|
protected static com.google.protobuf.DescriptorProtos.DescriptorProto |
buildDescriptorProtoWithFields(com.google.protobuf.DescriptorProtos.DescriptorProto.Builder descriptorBuilder,
com.google.cloud.bigquery.FieldList fields,
int depth) |
static com.google.protobuf.DynamicMessage |
buildSingleRowMessage(org.apache.spark.sql.types.StructType schema,
com.google.protobuf.Descriptors.Descriptor schemaDescriptor,
org.apache.spark.sql.catalyst.InternalRow row,
Optional<Map<Integer,ProtobufUtils.ProtobufSchemaFieldCacheEntry>> fieldIndexToEntryMap,
com.google.protobuf.DynamicMessage.Builder messageBuilder) |
protected static com.google.protobuf.DescriptorProtos.FieldDescriptorProto.Builder |
createProtoFieldBuilder(String fieldName,
com.google.protobuf.DescriptorProtos.FieldDescriptorProto.Label fieldLabel,
int messageNumber,
com.google.protobuf.DescriptorProtos.FieldDescriptorProto.Type fieldType) |
static com.google.protobuf.Descriptors.Descriptor |
toDescriptor(org.apache.spark.sql.types.StructType schema) |
static com.google.cloud.bigquery.storage.v1.ProtoRows |
toProtoRows(org.apache.spark.sql.types.StructType sparkSchema,
org.apache.spark.sql.catalyst.InternalRow[] rows)
Spark Row --> ProtoRows converter utils: To be used by the DataWriters facing the BigQuery
Storage Write API
|
static com.google.cloud.bigquery.storage.v1.ProtoSchema |
toProtoSchema(com.google.cloud.bigquery.Schema schema)
BigQuery Schema ==> ProtoSchema converter utils:
|
static com.google.cloud.bigquery.storage.v1.ProtoSchema |
toProtoSchema(org.apache.spark.sql.types.StructType schema) |
public static com.google.cloud.bigquery.storage.v1.ProtoSchema toProtoSchema(com.google.cloud.bigquery.Schema schema)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static com.google.cloud.bigquery.storage.v1.ProtoSchema toProtoSchema(org.apache.spark.sql.types.StructType schema)
throws IllegalArgumentException
IllegalArgumentExceptionprotected static com.google.protobuf.DescriptorProtos.DescriptorProto buildDescriptorProtoWithFields(com.google.protobuf.DescriptorProtos.DescriptorProto.Builder descriptorBuilder,
com.google.cloud.bigquery.FieldList fields,
int depth)
protected static com.google.protobuf.DescriptorProtos.FieldDescriptorProto.Builder createProtoFieldBuilder(String fieldName, com.google.protobuf.DescriptorProtos.FieldDescriptorProto.Label fieldLabel, int messageNumber, com.google.protobuf.DescriptorProtos.FieldDescriptorProto.Type fieldType)
public static com.google.cloud.bigquery.storage.v1.ProtoRows toProtoRows(org.apache.spark.sql.types.StructType sparkSchema,
org.apache.spark.sql.catalyst.InternalRow[] rows)
public static com.google.protobuf.DynamicMessage buildSingleRowMessage(org.apache.spark.sql.types.StructType schema,
com.google.protobuf.Descriptors.Descriptor schemaDescriptor,
org.apache.spark.sql.catalyst.InternalRow row,
Optional<Map<Integer,ProtobufUtils.ProtobufSchemaFieldCacheEntry>> fieldIndexToEntryMap,
com.google.protobuf.DynamicMessage.Builder messageBuilder)
public static com.google.protobuf.Descriptors.Descriptor toDescriptor(org.apache.spark.sql.types.StructType schema)
throws com.google.protobuf.Descriptors.DescriptorValidationException
com.google.protobuf.Descriptors.DescriptorValidationExceptionCopyright © 2024. All rights reserved.