1.39.4 (latest) 1.39.3 1.38.0 1.37.0 1.36.0 1.35.2 1.34.7 1.33.1 1.32.0 1.31.1 1.30.3 1.29.0 1.28.3 1.27.0 1.26.1 1.25.1 1.24.2 1.23.10 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](https://cloud.google.com/bigquery/docs/reference/rest/v2/Job).

Example:

```php
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

## Implements

[JobConfigurationInterface](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery/latest/JobConfigurationInterface.md.txt)

## 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:

```php
$extractJobConfig->compression('GZIP');
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `compression` | `string` The compression type. Acceptable values include `"GZIP"`, `"NONE"`. **Defaults to** `"NONE"`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ExtractJobConfiguration` |   |

### destinationFormat

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

Example:

```php
$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. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ExtractJobConfiguration` |   |

### destinationUris

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

Example:

```php
$extractJobConfig->destinationUris([
    'gs://my_bucket/destination.csv'
]);
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `destinationUris` | `array` The destination URIs. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ExtractJobConfiguration` |   |

### fieldDelimiter

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

Not applicable when extracting models.

Example:

```php
$extractJobConfig->fieldDelimiter(',');
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `fieldDelimiter` | `string` The field delimiter. **Defaults to** `","`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ExtractJobConfiguration` |   |

### printHeader

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

Not applicable when extracting models.

Example:

```php
$extractJobConfig->printHeader(false);
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `printHeader` | `bool` Whether or not to print out a header row. *Defaults to* \* `true`. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ExtractJobConfiguration` |   |

### sourceTable

Sets a reference to the table being exported.

Cannot be used in the same job as
[ExtractJobConfiguration::sourceModel()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery/latest/ExtractJobConfiguration.md.txt#_Google_Cloud_BigQuery_ExtractJobConfiguration__sourceModel__).

Example:

```php
$table = $bigQuery->dataset('my_dataset')
    ->table('my_table');
$extractJobConfig->sourceTable($table);
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `sourceTable` | `Table` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ExtractJobConfiguration` |   |

### sourceModel

Sets a reference to the model being exported.

Cannot be used in the same job as
[ExtractJobConfiguration::sourceTable()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery/latest/ExtractJobConfiguration.md.txt#_Google_Cloud_BigQuery_ExtractJobConfiguration__sourceTable__).

Example:

```php
$model = $bigQuery->dataset('my_dataset')
    ->model('my_model');
$extractJobConfig->sourceModel($model);
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `sourceModel` | `Model` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ExtractJobConfiguration` |   |

### 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:

```php
$extractJobConfig->useAvroLogicalTypes(true);
```

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `useAvroLogicalTypes` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ExtractJobConfiguration` |   |