Skip to content

Commit

Permalink
Merge pull request #1064 from tseaver/bigquery-jobs_copy
Browse files Browse the repository at this point in the history
Add job for copying tables.
  • Loading branch information
tseaver committed Aug 18, 2015
2 parents 7887c37 + 4c4c384 commit 1259287
Show file tree
Hide file tree
Showing 4 changed files with 791 additions and 282 deletions.
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

0 comments on commit 1259287

Please sign in to comment.