Class BigQuerySchemaUtil

java.lang.Object
com.google.cloud.bigquery.storage.v1.BigQuerySchemaUtil

public class BigQuerySchemaUtil extends Object
  • Constructor Details

    • BigQuerySchemaUtil

      public BigQuerySchemaUtil()
  • Method Details

    • isProtoCompatible

      public static boolean isProtoCompatible(String fieldName)
      * 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

      public static String generatePlaceholderFieldName(String fieldName)
      * 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

      public static String getFieldName(com.google.protobuf.Descriptors.FieldDescriptor fieldDescriptor)
      * Gets the user-facing field name from the descriptor
      Parameters:
      fieldDescriptor -
      Returns:
      columnName annotation if present, otherwise return the field name.