Reference documentation and code samples for the BigQuery Client class CopyJobConfiguration.
Represents a configuration for a copy job. For more information on the available settings please see the Jobs configuration API documentation .
Example:
use Google\Cloud\BigQuery\BigQueryClient;
$bigQuery = new BigQueryClient();
$sourceTable = $bigQuery->dataset('my_dataset')
->table('my_source_table');
$destinationTable = $bigQuery->dataset('my_dataset')
->table('my_destination_table');
$copyJobConfig = $sourceTable->copy($destinationTable);
Namespace
Google \ Cloud \ BigQueryMethods
__construct
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.
createDisposition
Set whether the job is allowed to create new tables. Creation, truncation and append actions occur as one atomic update upon job completion.
Example:
$copyJobConfig->createDisposition('CREATE_NEVER');
createDisposition
string
The create disposition. Acceptable
values include "CREATED_IF_NEEDED"
, "CREATE_NEVER"
. Defaults
to "CREATE_IF_NEEDED"
.
destinationEncryptionConfiguration
Sets the custom encryption configuration (e.g., Cloud KMS keys).
Example:
$copyJobConfig->destinationEncryptionConfiguration([
'kmsKeyName' => 'my_key'
]);
configuration
array
Custom encryption configuration.
destinationTable
Sets the destination table.
Example:
$table = $bigQuery->dataset('my_dataset')
->table('my_table');
$copyJobConfig->destinationTable($table);
sourceTable
Sets the source table to copy.
Example:
$table = $bigQuery->dataset('my_dataset')
->table('source_table');
$copyJobConfig->sourceTable($table);
writeDisposition
Sets the action that occurs if the destination table already exists. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion.
Example:
$copyJobConfig->writeDisposition('WRITE_TRUNCATE');
writeDisposition
string
The write disposition. Acceptable values
include "WRITE_TRUNCATE"
, "WRITE_APPEND"
, "WRITE_EMPTY"
. Defaults to "WRITE_EMPTY"
.