@@ -39,6 +39,7 @@ public final class LoadJobConfiguration extends JobConfiguration implements Load
3939
4040 private final List <String > sourceUris ;
4141 private final String fileSetSpecType ;
42+ private final String columnNameCharacterMap ;
4243 private final TableId destinationTable ;
4344 private final List <String > decimalTargetTypes ;
4445 private final EncryptionConfiguration destinationEncryptionConfiguration ;
@@ -69,6 +70,8 @@ public static final class Builder extends JobConfiguration.Builder<LoadJobConfig
6970
7071 private List <String > sourceUris ;
7172 private String fileSetSpecType ;
73+ private String columnNameCharacterMap ;
74+
7275 private TableId destinationTable ;
7376 private List <String > decimalTargetTypes ;
7477 private EncryptionConfiguration destinationEncryptionConfiguration ;
@@ -110,6 +113,7 @@ private Builder(LoadJobConfiguration loadConfiguration) {
110113 this .ignoreUnknownValues = loadConfiguration .ignoreUnknownValues ;
111114 this .sourceUris = loadConfiguration .sourceUris ;
112115 this .fileSetSpecType = loadConfiguration .fileSetSpecType ;
116+ this .columnNameCharacterMap = loadConfiguration .columnNameCharacterMap ;
113117 this .schemaUpdateOptions = loadConfiguration .schemaUpdateOptions ;
114118 this .autodetect = loadConfiguration .autodetect ;
115119 this .destinationEncryptionConfiguration =
@@ -181,6 +185,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur
181185 if (loadConfigurationPb .getFileSetSpecType () != null ) {
182186 this .fileSetSpecType = loadConfigurationPb .getFileSetSpecType ();
183187 }
188+ if (loadConfigurationPb .getColumnNameCharacterMap () != null ) {
189+ this .columnNameCharacterMap = loadConfigurationPb .getColumnNameCharacterMap ();
190+ }
184191 if (loadConfigurationPb .getSchemaUpdateOptions () != null ) {
185192 ImmutableList .Builder <JobInfo .SchemaUpdateOption > schemaUpdateOptionsBuilder =
186193 new ImmutableList .Builder <>();
@@ -323,6 +330,20 @@ public Builder setFileSetSpecType(String fileSetSpecType) {
323330 return this ;
324331 }
325332
333+ /**
334+ * [Optional] Character map supported for column names in CSV/Parquet loads. Defaults to STRICT
335+ * and can be overridden by Project Config Service. Using this option with unsupporting load
336+ * formats will result in an error.
337+ *
338+ * @see <a
339+ * href="https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#columnnamecharactermap">
340+ * ColumnNameCharacterMap</a>
341+ */
342+ public Builder setColumnNameCharacterMap (String columnNameCharacterMap ) {
343+ this .columnNameCharacterMap = columnNameCharacterMap ;
344+ return this ;
345+ }
346+
326347 /**
327348 * Defines the list of possible SQL data types to which the source decimal values are converted.
328349 * This list and the precision and the scale parameters of the decimal field determine the
@@ -421,6 +442,7 @@ private LoadJobConfiguration(Builder builder) {
421442 super (builder );
422443 this .sourceUris = builder .sourceUris ;
423444 this .fileSetSpecType = builder .fileSetSpecType ;
445+ this .columnNameCharacterMap = builder .columnNameCharacterMap ;
424446 this .destinationTable = builder .destinationTable ;
425447 this .decimalTargetTypes = builder .decimalTargetTypes ;
426448 this .createDisposition = builder .createDisposition ;
@@ -519,6 +541,17 @@ public String getFileSetSpecType() {
519541 return fileSetSpecType ;
520542 }
521543
544+ /**
545+ * Returns the column name character map used in CSV/Parquet loads.
546+ *
547+ * @see <a
548+ * href="https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#columnnamecharactermap">
549+ * ColumnNameCharacterMap</a>
550+ */
551+ public String getColumnNameCharacterMap () {
552+ return columnNameCharacterMap ;
553+ }
554+
522555 public List <String > getDecimalTargetTypes () {
523556 return decimalTargetTypes ;
524557 }
@@ -598,6 +631,7 @@ ToStringHelper toStringHelper() {
598631 .add ("ignoreUnknownValue" , ignoreUnknownValues )
599632 .add ("sourceUris" , sourceUris )
600633 .add ("fileSetSpecType" , fileSetSpecType )
634+ .add ("columnNameCharacterMap" , columnNameCharacterMap )
601635 .add ("schemaUpdateOptions" , schemaUpdateOptions )
602636 .add ("autodetect" , autodetect )
603637 .add ("timePartitioning" , timePartitioning )
@@ -681,6 +715,9 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() {
681715 if (fileSetSpecType != null ) {
682716 loadConfigurationPb .setFileSetSpecType (fileSetSpecType );
683717 }
718+ if (columnNameCharacterMap != null ) {
719+ loadConfigurationPb .setColumnNameCharacterMap (columnNameCharacterMap );
720+ }
684721 if (decimalTargetTypes != null ) {
685722 loadConfigurationPb .setDecimalTargetTypes (ImmutableList .copyOf (decimalTargetTypes ));
686723 }
0 commit comments