diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java index fefff3409..1696b1fc1 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java @@ -152,7 +152,8 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur || loadConfigurationPb.getEncoding() != null || loadConfigurationPb.getFieldDelimiter() != null || loadConfigurationPb.getQuote() != null - || loadConfigurationPb.getSkipLeadingRows() != null) { + || loadConfigurationPb.getSkipLeadingRows() != null + || loadConfigurationPb.getPreserveAsciiControlCharacters() != null) { CsvOptions.Builder builder = CsvOptions.newBuilder() .setEncoding(loadConfigurationPb.getEncoding()) @@ -167,6 +168,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (loadConfigurationPb.getSkipLeadingRows() != null) { builder.setSkipLeadingRows(loadConfigurationPb.getSkipLeadingRows()); } + if (loadConfigurationPb.getPreserveAsciiControlCharacters() != null) { + builder.setPreserveAsciiControlCharacters(loadConfigurationPb.getPreserveAsciiControlCharacters()); + } this.formatOptions = builder.build(); } this.maxBadRecords = loadConfigurationPb.getMaxBadRecords(); @@ -653,7 +657,8 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() { .setAllowJaggedRows(csvOptions.allowJaggedRows()) .setAllowQuotedNewlines(csvOptions.allowQuotedNewLines()) .setEncoding(csvOptions.getEncoding()) - .setQuote(csvOptions.getQuote()); + .setQuote(csvOptions.getQuote()) + .setPreserveAsciiControlCharacters(csvOptions.getPreserveAsciiControlCharacters()); if (csvOptions.getSkipLeadingRows() != null) { // todo(mziccard) remove checked cast or comment when #1044 is closed loadConfigurationPb.setSkipLeadingRows(Ints.checkedCast(csvOptions.getSkipLeadingRows())); diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java index 114c6dadd..f270eadf2 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/WriteChannelConfiguration.java @@ -127,7 +127,8 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur || loadConfigurationPb.getEncoding() != null || loadConfigurationPb.getFieldDelimiter() != null || loadConfigurationPb.getQuote() != null - || loadConfigurationPb.getSkipLeadingRows() != null) { + || loadConfigurationPb.getSkipLeadingRows() != null + || loadConfigurationPb.getPreserveAsciiControlCharacters() != null) { CsvOptions.Builder builder = CsvOptions.newBuilder() .setEncoding(loadConfigurationPb.getEncoding()) @@ -142,6 +143,9 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur if (loadConfigurationPb.getSkipLeadingRows() != null) { builder.setSkipLeadingRows(loadConfigurationPb.getSkipLeadingRows()); } + if (loadConfigurationPb.getPreserveAsciiControlCharacters() != null) { + builder.setPreserveAsciiControlCharacters(loadConfigurationPb.getPreserveAsciiControlCharacters()); + } this.formatOptions = builder.build(); } this.maxBadRecords = loadConfigurationPb.getMaxBadRecords();