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.
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).
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).
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 (',').
[Optional] Specifies a string that represents a null value in a CSV file. For example, if you
specify "\N", BigQuery interprets "\N" as a null value when querying a CSV file. The
default value is the empty string. If you set this property to a custom value, BigQuery
throws an error if an empty string is present for all data types except for STRING and BYTE.
For STRING and BYTE columns, BigQuery interprets the empty string as an empty value.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class CsvOptions.Builder (2.54.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.54.1 (latest)](/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.54.0](/java/docs/reference/google-cloud-bigquery/2.54.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.53.0](/java/docs/reference/google-cloud-bigquery/2.53.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.52.0](/java/docs/reference/google-cloud-bigquery/2.52.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.51.0](/java/docs/reference/google-cloud-bigquery/2.51.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.50.1](/java/docs/reference/google-cloud-bigquery/2.50.1/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.49.0](/java/docs/reference/google-cloud-bigquery/2.49.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.48.1](/java/docs/reference/google-cloud-bigquery/2.48.1/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.47.0](/java/docs/reference/google-cloud-bigquery/2.47.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.46.0](/java/docs/reference/google-cloud-bigquery/2.46.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.45.0](/java/docs/reference/google-cloud-bigquery/2.45.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.44.0](/java/docs/reference/google-cloud-bigquery/2.44.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.43.3](/java/docs/reference/google-cloud-bigquery/2.43.3/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.42.3](/java/docs/reference/google-cloud-bigquery/2.42.3/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.41.0](/java/docs/reference/google-cloud-bigquery/2.41.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.40.3](/java/docs/reference/google-cloud-bigquery/2.40.3/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.39.1](/java/docs/reference/google-cloud-bigquery/2.39.1/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.38.2](/java/docs/reference/google-cloud-bigquery/2.38.2/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.37.2](/java/docs/reference/google-cloud-bigquery/2.37.2/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.36.0](/java/docs/reference/google-cloud-bigquery/2.36.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.35.0](/java/docs/reference/google-cloud-bigquery/2.35.0/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.34.2](/java/docs/reference/google-cloud-bigquery/2.34.2/com.google.cloud.bigquery.CsvOptions.Builder)\n- [2.33.2](/java/docs/reference/google-cloud-bigquery/2.33.2/com.google.cloud.bigquery.CsvOptions.Builder) \n\n public static final class CsvOptions.Builder\n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e CsvOptions.Builder \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nMethods\n-------\n\n### build()\n\n public CsvOptions build()\n\nCreates a `CsvOptions` object.\n\n### setAllowJaggedRows(boolean allowJaggedRows)\n\n public CsvOptions.Builder setAllowJaggedRows(boolean allowJaggedRows)\n\nSet whether BigQuery should accept rows that are missing trailing optional columns. If `\ntrue`, BigQuery treats missing trailing columns as null values. If `false`, records\nwith missing trailing columns are treated as bad records, and if there are too many bad\nrecords, an invalid error is returned in the job result. By default, rows with missing\ntrailing columns are considered bad records.\n\n### setAllowQuotedNewLines(boolean allowQuotedNewLines)\n\n public CsvOptions.Builder setAllowQuotedNewLines(boolean allowQuotedNewLines)\n\nSets whether BigQuery should allow quoted data sections that contain newline characters in a\nCSV file. By default quoted newline are not allowed.\n\n### setEncoding(String encoding)\n\n public CsvOptions.Builder setEncoding(String encoding)\n\nSets the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The\ndefault value is UTF-8. BigQuery decodes the data after the raw, binary data has been split\nusing the values set in [#setQuote(String)](/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.CsvOptions.Builder#com_google_cloud_bigquery_CsvOptions_Builder_setQuote_java_lang_String_) and [#setFieldDelimiter(String)](/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.CsvOptions.Builder#com_google_cloud_bigquery_CsvOptions_Builder_setFieldDelimiter_java_lang_String_).\n\n### setEncoding(Charset encoding)\n\n public CsvOptions.Builder setEncoding(Charset encoding)\n\nSets the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. The\ndefault value is UTF-8. BigQuery decodes the data after the raw, binary data has been split\nusing the values set in [#setQuote(String)](/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.CsvOptions.Builder#com_google_cloud_bigquery_CsvOptions_Builder_setQuote_java_lang_String_) and [#setFieldDelimiter(String)](/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.CsvOptions.Builder#com_google_cloud_bigquery_CsvOptions_Builder_setFieldDelimiter_java_lang_String_).\n\n### setFieldDelimiter(String fieldDelimiter)\n\n public CsvOptions.Builder setFieldDelimiter(String fieldDelimiter)\n\nSets the separator for fields in a CSV file. BigQuery converts the string to ISO-8859-1\nencoding, and then uses the first byte of the encoded string to split the data in its raw,\nbinary state. BigQuery also supports the escape sequence \" \" to specify a tab separator. The\ndefault value is a comma (',').\n\n### setNullMarker(String nullMarker)\n\n public CsvOptions.Builder setNullMarker(String nullMarker)\n\n\\[Optional\\] Specifies a string that represents a null value in a CSV file. For example, if you\nspecify \"\\\\N\", BigQuery interprets \"\\\\N\" as a null value when querying a CSV file. The\ndefault value is the empty string. If you set this property to a custom value, BigQuery\nthrows an error if an empty string is present for all data types except for STRING and BYTE.\nFor STRING and BYTE columns, BigQuery interprets the empty string as an empty value.\n\n### setPreserveAsciiControlCharacters(boolean preserveAsciiControlCharacters)\n\n public CsvOptions.Builder setPreserveAsciiControlCharacters(boolean preserveAsciiControlCharacters)\n\nSets whether BigQuery should allow ASCII control characters in a CSV file. By default ASCII\ncontrol characters are not allowed.\n\n### setQuote(String quote)\n\n public CsvOptions.Builder setQuote(String quote)\n\nSets the value that is used to quote data sections in a CSV file. BigQuery converts the\nstring to ISO-8859-1 encoding, and then uses the first byte of the encoded string to split\nthe data in its raw, binary state. The default value is a double-quote ('\"'). If your data\ndoes not contain quoted sections, set the property value to an empty string. If your data\ncontains quoted newline characters, you must also set [#setAllowQuotedNewLines(boolean)](/java/docs/reference/google-cloud-bigquery/latest/com.google.cloud.bigquery.CsvOptions.Builder#com_google_cloud_bigquery_CsvOptions_Builder_setAllowQuotedNewLines_boolean_) property to `true`.\n\n### setSkipLeadingRows(long skipLeadingRows)\n\n public CsvOptions.Builder setSkipLeadingRows(long skipLeadingRows)\n\nSets the number of rows at the top of a CSV file that BigQuery will skip when reading the\ndata. The default value is 0. This property is useful if you have header rows in the file\nthat should be skipped."]]