Package com.google.cloud.bigquery
Class CsvOptions
- java.lang.Object
-
- com.google.cloud.bigquery.FormatOptions
-
- com.google.cloud.bigquery.CsvOptions
-
- All Implemented Interfaces:
Serializable
public final class CsvOptions extends FormatOptions
Google BigQuery options for CSV format. This class wraps some properties of CSV files used by BigQuery to parse external data.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CsvOptions.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
allowJaggedRows()
Returns whether BigQuery should accept rows that are missing trailing optional columns.Boolean
allowQuotedNewLines()
Returns whether BigQuery should allow quoted data sections that contain newline characters in a CSV file.boolean
equals(Object obj)
String
getEncoding()
Returns the character encoding of the data.String
getFieldDelimiter()
Returns the separator for fields in a CSV file.Boolean
getPreserveAsciiControlCharacters()
Returns whether BigQuery should allow ascii control characters in a CSV file.String
getQuote()
Returns the value that is used to quote data sections in a CSV file.Long
getSkipLeadingRows()
Returns the number of rows at the top of a CSV file that BigQuery will skip when reading the data.int
hashCode()
static CsvOptions.Builder
newBuilder()
Returns a builder for a CsvOptions object.CsvOptions.Builder
toBuilder()
Returns a builder for theCsvOptions
object.String
toString()
-
Methods inherited from class com.google.cloud.bigquery.FormatOptions
avro, bigtable, csv, datastoreBackup, getType, googleSheets, iceberg, json, of, orc, parquet
-
-
-
-
Method Detail
-
allowJaggedRows
public Boolean allowJaggedRows()
Returns 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 the number of bad records exceedsExternalTableDefinition.getMaxBadRecords()
, an invalid error is returned in the job result.
-
allowQuotedNewLines
public Boolean allowQuotedNewLines()
Returns whether BigQuery should allow quoted data sections that contain newline characters in a CSV file.
-
getEncoding
public String getEncoding()
Returns the character encoding of the data. The supported values are UTF-8 or ISO-8859-1. If not set, UTF-8 is used. BigQuery decodes the data after the raw, binary data has been split using the values set ingetQuote()
andgetFieldDelimiter()
.
-
getFieldDelimiter
public String getFieldDelimiter()
Returns the separator for fields in a CSV file.
-
getQuote
public String getQuote()
Returns the value that is used to quote data sections in a CSV file.
-
getSkipLeadingRows
public Long getSkipLeadingRows()
Returns the number of rows at the top of a CSV file that BigQuery will skip when reading the data.
-
getPreserveAsciiControlCharacters
public Boolean getPreserveAsciiControlCharacters()
Returns whether BigQuery should allow ascii control characters in a CSV file. By default ascii control characters are not allowed.
-
toBuilder
public CsvOptions.Builder toBuilder()
Returns a builder for theCsvOptions
object.
-
toString
public String toString()
- Overrides:
toString
in classFormatOptions
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classFormatOptions
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classFormatOptions
-
newBuilder
public static CsvOptions.Builder newBuilder()
Returns a builder for a CsvOptions object.
-
-