Package com.google.cloud.bigquery
Class CsvOptions.Builder
java.lang.Object
com.google.cloud.bigquery.CsvOptions.Builder
- Enclosing class:
- CsvOptions
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Creates aCsvOptions
object.setAllowJaggedRows
(boolean allowJaggedRows) Set whether BigQuery should accept rows that are missing trailing optional columns.setAllowQuotedNewLines
(boolean allowQuotedNewLines) Sets whether BigQuery should allow quoted data sections that contain newline characters in a CSV file.setEncoding
(String encoding) Sets the character encoding of the data.setEncoding
(Charset encoding) Sets the character encoding of the data.setFieldDelimiter
(String fieldDelimiter) Sets the separator for fields in a CSV file.setPreserveAsciiControlCharacters
(boolean preserveAsciiControlCharacters) Sets whether BigQuery should allow ASCII control characters in a CSV file.Sets the value that is used to quote data sections in a CSV file.setSkipLeadingRows
(long skipLeadingRows) Sets the number of rows at the top of a CSV file that BigQuery will skip when reading the data.
-
Method Details
-
setAllowJaggedRows
Set whether BigQuery should accept rows that are missing trailing optional columns. Iftrue
, BigQuery treats missing trailing columns as null values. Iffalse
, 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. -
setAllowQuotedNewLines
Sets whether BigQuery should allow quoted data sections that contain newline characters in a CSV file. By default quoted newline are not allowed. -
setEncoding
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 insetQuote(String)
andsetFieldDelimiter(String)
. -
setEncoding
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 insetQuote(String)
andsetFieldDelimiter(String)
. -
setFieldDelimiter
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 "\t" to specify a tab separator. The default value is a comma (','). -
setQuote
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 setsetAllowQuotedNewLines(boolean)
property totrue
. -
setSkipLeadingRows
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. -
setPreserveAsciiControlCharacters
Sets whether BigQuery should allow ASCII control characters in a CSV file. By default ASCII control characters are not allowed. -
build
Creates aCsvOptions
object.
-