BigQuery Client - Class ExtractJobConfiguration (1.29.0)

Reference documentation and code samples for the BigQuery Client class ExtractJobConfiguration.

Represents a configuration for an extract job. For more information on the available settings please see the Jobs configuration API documentation .

Example:

 use Google\Cloud\BigQuery\BigQueryClient;

$bigQuery = new BigQueryClient();
$table = $bigQuery->dataset('my_dataset')
    ->table('my_table');
$extractJobConfig = $table->extract('gs://my_bucket/target.csv'); 

Namespace

Google \ Cloud \ BigQuery

Methods

__construct

Parameters
Name
Description
projectId
string

The project's ID.

config
array

A set of configuration options for a job.

location
string|null

The geographic location in which the job is executed.

compression

Sets the compression type to use for exported files.

Not applicable when extracting models.

Example:

 $extractJobConfig->compression('GZIP'); 
Parameter
Name
Description
compression
string

The compression type. Acceptable values include "GZIP" , "NONE" . Defaults to "NONE" .

destinationFormat

Sets the exported file format. Tables with nested or repeated fields cannot be exported as CSV.

Example:

 $extractJobConfig->destinationFormat('NEWLINE_DELIMITED_JSON'); 
Parameter
Name
Description
destinationFormat
string

The exported file format. Acceptable values for tables include CSV , NEWLINE_DELIMITED_JSON , AVRO . For models, acceptable values include ML_TF_SAVED_MODEL and ML_XGBOOST_BOOSTER . Defaults to CSV for tables, or ML_TF_SAVED_MODEL for models.

destinationUris

Sets a list of fully-qualified Google Cloud Storage URIs where the extracted table should be written.

Example:

 $extractJobConfig->destinationUris([
    'gs://my_bucket/destination.csv'
]); 
Parameter
Name
Description
destinationUris
array

The destination URIs.

fieldDelimiter

Sets the delimiter to use between fields in the exported data.

Not applicable when extracting models.

Example:

 $extractJobConfig->fieldDelimiter(','); 
Parameter
Name
Description
fieldDelimiter
string

The field delimiter. Defaults to "," .

printHeader

Sets whether or not to print out a header row in the results.

Not applicable when extracting models.

Example:

 $extractJobConfig->printHeader(false); 
Parameter
Name
Description
printHeader
bool

Whether or not to print out a header row. Defaults to true .

sourceTable

Sets a reference to the table being exported.

Cannot be used in the same job as Google\Cloud\BigQuery\ExtractJobConfiguration::sourceModel() .

Example:

 $table = $bigQuery->dataset('my_dataset')
    ->table('my_table');
$extractJobConfig->sourceTable($table); 
Parameter
Name
Description

sourceModel

Sets a reference to the model being exported.

Cannot be used in the same job as Google\Cloud\BigQuery\ExtractJobConfiguration::sourceTable() .

Example:

 $model = $bigQuery->dataset('my_dataset')
    ->model('my_model');
$extractJobConfig->sourceModel($model); 
Parameter
Name
Description

useAvroLogicalTypes

Sets whether to use logical types when extracting to AVRO format.

If destinationFormat is set to "AVRO", this flag indicates whether to enable extracting applicable column types (such as TIMESTAMP) to their corresponding AVRO logical types (timestamp-micros), instead of only using their raw types (avro-long).

Not applicable when extracting models.

Example:

 $extractJobConfig->useAvroLogicalTypes(true); 
Parameter
Name
Description
useAvroLogicalTypes
bool
Create a Mobile Website
View Site in Mobile | Classic
Share by: