Class CsvOptions.Builder (2.35.0)

public static final class CsvOptions.Builder

Inheritance

java.lang.Object > CsvOptions.Builder

Methods

build()

public CsvOptions build()

Creates a CsvOptions object.

Returns
TypeDescription
CsvOptions

setAllowJaggedRows(boolean allowJaggedRows)

public CsvOptions.Builder setAllowJaggedRows(boolean allowJaggedRows)

Set whether BigQuery should accept rows that are missing trailing optional columns. If true, BigQuery treats missing trailing columns as null values. If false, records with missing trailing columns are treated as bad records, and if there are too many bad records, an invalid error is returned in the job result. By default, rows with missing trailing columns are considered bad records.

Parameter
NameDescription
allowJaggedRowsboolean
Returns
TypeDescription
CsvOptions.Builder

setAllowQuotedNewLines(boolean allowQuotedNewLines)

public CsvOptions.Builder setAllowQuotedNewLines(boolean allowQuotedNewLines)

Sets whether BigQuery should allow quoted data sections that contain newline characters in a CSV file. By default quoted newline are not allowed.

Parameter
NameDescription
allowQuotedNewLinesboolean
Returns
TypeDescription
CsvOptions.Builder

setEncoding(String encoding)

public CsvOptions.Builder setEncoding(String encoding)

Sets the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values set in #setQuote(String) and #setFieldDelimiter(String).

Parameter
NameDescription
encodingString
Returns
TypeDescription
CsvOptions.Builder

setEncoding(Charset encoding)

public CsvOptions.Builder setEncoding(Charset encoding)

Sets the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data after the raw, binary data has been split using the values set in #setQuote(String) and #setFieldDelimiter(String).

Parameter
NameDescription
encodingCharset
Returns
TypeDescription
CsvOptions.Builder

setFieldDelimiter(String fieldDelimiter)

public CsvOptions.Builder setFieldDelimiter(String fieldDelimiter)

Sets the separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. BigQuery also supports the escape sequence " " to specify a tab separator. The default value is a comma (',').

Parameter
NameDescription
fieldDelimiterString
Returns
TypeDescription
CsvOptions.Builder

setPreserveAsciiControlCharacters(boolean preserveAsciiControlCharacters)

public CsvOptions.Builder setPreserveAsciiControlCharacters(boolean preserveAsciiControlCharacters)

Sets whether BigQuery should allow ASCII control characters in a CSV file. By default ASCII control characters are not allowed.

Parameter
NameDescription
preserveAsciiControlCharactersboolean
Returns
TypeDescription
CsvOptions.Builder

setQuote(String quote)

public CsvOptions.Builder setQuote(String quote)

Sets the value that is used to quote data sections in a CSV file. BigQuery converts the string to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split the data in its raw, binary state. The default value is a double-quote ('"'). If your data does not contain quoted sections, set the property value to an empty string. If your data contains quoted newline characters, you must also set #setAllowQuotedNewLines(boolean) property to true.

Parameter
NameDescription
quoteString
Returns
TypeDescription
CsvOptions.Builder

setSkipLeadingRows(long skipLeadingRows)

public CsvOptions.Builder setSkipLeadingRows(long skipLeadingRows)

Sets the number of rows at the top of a CSV file that BigQuery will skip when reading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped.

Parameter
NameDescription
skipLeadingRowslong
Returns
TypeDescription
CsvOptions.Builder