Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add proto annotation for non-ascii field mapping #1776

Merged
merged 2 commits into from Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,86 @@
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/bigquery/storage/v1/annotations.proto

package com.google.cloud.bigquery.storage.v1;

public final class AnnotationsProto {
private AnnotationsProto() {}

public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {
registry.add(com.google.cloud.bigquery.storage.v1.AnnotationsProto.columnName);
}

public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
}

public static final int COLUMN_NAME_FIELD_NUMBER = 454943157;
/**
*
*
* <pre>
* Setting the column_name extension allows users to reference
* bigquery column independently of the field name in the protocol buffer
* message.
* The intended use of this annotation is to reference a destination column
* named using characters unavailable for protobuf field names (e.g. unicode
* characters).
* More details about BigQuery naming limitations can be found here:
* https://cloud.google.com/bigquery/docs/schemas#column_names
* This extension is currently experimental.
* </pre>
*
* <code>extend .google.protobuf.FieldOptions { ... }</code>
*/
public static final com.google.protobuf.GeneratedMessage.GeneratedExtension<
com.google.protobuf.DescriptorProtos.FieldOptions, java.lang.String>
columnName =
com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension(
java.lang.String.class, null);

public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
return descriptor;
}

private static com.google.protobuf.Descriptors.FileDescriptor descriptor;

static {
java.lang.String[] descriptorData = {
"\n2google/cloud/bigquery/storage/v1/annot"
+ "ations.proto\022 google.cloud.bigquery.stor"
+ "age.v1\032 google/protobuf/descriptor.proto"
+ ":9\n\013column_name\022\035.google.protobuf.FieldO"
+ "ptions\030\265\303\367\330\001 \001(\t\210\001\001B\311\001\n$com.google.cloud"
+ ".bigquery.storage.v1B\020AnnotationsProtoP\001"
+ "ZGgoogle.golang.org/genproto/googleapis/"
+ "cloud/bigquery/storage/v1;storage\252\002 Goog"
+ "le.Cloud.BigQuery.Storage.V1\312\002 Google\\Cl"
+ "oud\\BigQuery\\Storage\\V1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.google.protobuf.DescriptorProtos.getDescriptor(),
});
columnName.internalInit(descriptor.getExtensions().get(0));
com.google.protobuf.DescriptorProtos.getDescriptor();
}

// @@protoc_insertion_point(outer_class_scope)
}
@@ -0,0 +1,28 @@
syntax = "proto3";

package google.cloud.bigquery.storage.v1;

import "google/protobuf/descriptor.proto";

option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storage/v1;storage";
option java_package = "com.google.cloud.bigquery.storage.v1";
option java_multiple_files = true;
option java_outer_classname = "AnnotationsProto";
option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1";

extend google.protobuf.FieldOptions {
// Setting the column_name extension allows users to reference
// bigquery column independently of the field name in the protocol buffer
// message.
//
// The intended use of this annotation is to reference a destination column
// named using characters unavailable for protobuf field names (e.g. unicode
// characters).
//
// More details about BigQuery naming limitations can be found here:
// https://cloud.google.com/bigquery/docs/schemas#column_names
//
// This extension is currently experimental.
optional string column_name = 454943157;
}