FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: BQTableSchemaToProtoDescriptor setting of FieldOption. by PhongChuong · Pull Request #2743 · googleapis/java-bigquerystorage · GitHub

This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.google.protobuf.Descriptors;
import com.google.protobuf.Descriptors.Descriptor;
import com.google.protobuf.Descriptors.FileDescriptor;
import com.google.protobuf.ExtensionLite;
import com.google.protobuf.Message;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -217,13 +217,13 @@ private static FieldDescriptorProto convertBQTableFieldToProtoField(
// Sets columnName annotation when field name is not proto comptaible.
if (!BigQuerySchemaUtil.isProtoCompatible(fieldName)) {
fieldDescriptor.setName(BigQuerySchemaUtil.generatePlaceholderFieldName(fieldName));
fieldDescriptor.setOptions(
FieldOptions.newBuilder()
.setExtension(
(ExtensionLite<FieldOptions, String>) AnnotationsProto.columnName,
// Remove ExtensionLite after protobuf linkage error is resolved.
fieldName)
.build());

// The following work around (instead of setting FieldOptions directly) for when
// FieldOptions.Builder changes from GeneratedMessageV3 in 3.25 to GeneratedMessage in 4.28 as
// it no longer depends on FieldOptions.
Message.Builder fieldOptionBuilder = FieldOptions.newBuilder();
fieldOptionBuilder.setField(AnnotationsProto.columnName.getDescriptor(), fieldName);
fieldDescriptor.setOptions((FieldOptions) fieldOptionBuilder.build());
}
return fieldDescriptor.build();
}
Expand Down

Back | FazBrowse Home | New Git URL