Class BigQuerySchemaUtil
java.lang.Object
com.google.cloud.bigquery.storage.v1.BigQuerySchemaUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
generatePlaceholderFieldName
(String fieldName) * Generates a placeholder name that consists of a prefix + base64 encoded field name.static String
getFieldName
(com.google.protobuf.Descriptors.FieldDescriptor fieldDescriptor) * Gets the user-facing field name from the descriptorstatic boolean
isProtoCompatible
(String fieldName) * Checks if the field name is compatible with proto field naming convention.
-
Constructor Details
-
BigQuerySchemaUtil
public BigQuerySchemaUtil()
-
-
Method Details
-
isProtoCompatible
* Checks if the field name is compatible with proto field naming convention.- Parameters:
fieldName
- name for the field- Returns:
- true if the field name is comptaible with proto naming convention, otherwise, returns false.
-
generatePlaceholderFieldName
* Generates a placeholder name that consists of a prefix + base64 encoded field name. We replace all dashes with underscores as they are not allowed for proto field names.- Parameters:
fieldName
- name for the field- Returns:
- the generated placeholder field name
-
getFieldName
* Gets the user-facing field name from the descriptor- Parameters:
fieldDescriptor
-- Returns:
- columnName annotation if present, otherwise return the field name.
-