@@ -230,17 +230,22 @@ type CSVOptions struct {
230230 // An optional custom string that will represent a NULL
231231 // value in CSV import data.
232232 NullMarker string
233+
234+ // Preserves the embedded ASCII control characters (the first 32 characters in the ASCII-table,
235+ // from '\\x00' to '\\x1F') when loading from CSV. Only applicable to CSV, ignored for other formats.
236+ PreserveASCIIControlCharacters bool
233237}
234238
235239func (o * CSVOptions ) populateExternalDataConfig (c * bq.ExternalDataConfiguration ) {
236240 c .CsvOptions = & bq.CsvOptions {
237- AllowJaggedRows : o .AllowJaggedRows ,
238- AllowQuotedNewlines : o .AllowQuotedNewlines ,
239- Encoding : string (o .Encoding ),
240- FieldDelimiter : o .FieldDelimiter ,
241- Quote : o .quote (),
242- SkipLeadingRows : o .SkipLeadingRows ,
243- NullMarker : o .NullMarker ,
241+ AllowJaggedRows : o .AllowJaggedRows ,
242+ AllowQuotedNewlines : o .AllowQuotedNewlines ,
243+ Encoding : string (o .Encoding ),
244+ FieldDelimiter : o .FieldDelimiter ,
245+ Quote : o .quote (),
246+ SkipLeadingRows : o .SkipLeadingRows ,
247+ NullMarker : o .NullMarker ,
248+ PreserveAsciiControlCharacters : o .PreserveASCIIControlCharacters ,
244249 }
245250}
246251
@@ -267,12 +272,13 @@ func (o *CSVOptions) setQuote(ps *string) {
267272
268273func bqToCSVOptions (q * bq.CsvOptions ) * CSVOptions {
269274 o := & CSVOptions {
270- AllowJaggedRows : q .AllowJaggedRows ,
271- AllowQuotedNewlines : q .AllowQuotedNewlines ,
272- Encoding : Encoding (q .Encoding ),
273- FieldDelimiter : q .FieldDelimiter ,
274- SkipLeadingRows : q .SkipLeadingRows ,
275- NullMarker : q .NullMarker ,
275+ AllowJaggedRows : q .AllowJaggedRows ,
276+ AllowQuotedNewlines : q .AllowQuotedNewlines ,
277+ Encoding : Encoding (q .Encoding ),
278+ FieldDelimiter : q .FieldDelimiter ,
279+ SkipLeadingRows : q .SkipLeadingRows ,
280+ NullMarker : q .NullMarker ,
281+ PreserveASCIIControlCharacters : q .PreserveAsciiControlCharacters ,
276282 }
277283 o .setQuote (q .Quote )
278284 return o
0 commit comments