Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add job for copying tables. #1064

Merged
merged 10 commits into from
Aug 18, 2015
18 changes: 18 additions & 0 deletions gcloud/bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from gcloud.client import JSONClient
from gcloud.bigquery.connection import Connection
from gcloud.bigquery.dataset import Dataset
from gcloud.bigquery.job import CopyJob
from gcloud.bigquery.job import LoadTableFromStorageJob


Expand Down Expand Up @@ -115,3 +116,20 @@ def load_table_from_storage(self, name, destination, *source_uris):
"""
return LoadTableFromStorageJob(name, destination, source_uris,
client=self)

def copy_table(self, name, destination, *sources):
"""Construct a job for copying one or more tables into another table.

:type name: string
:param name: Name of the job.

:type destination: :class:`gcloud.bigquery.table.Table`
:param destination: Table into which data is to be copied.

:type sources: sequence of :class:`gcloud.bigquery.table.Table`
:param sources: tables to be copied.

:rtype: :class:`gcloud.bigquery.job.CopyJob`
:returns: a new ``CopyJob`` instance
"""
return CopyJob(name, destination, sources, client=self)
Loading