Skip to content

Commit 1259287

Browse files
committed
Merge pull request #1064 from tseaver/bigquery-jobs_copy
Add job for copying tables.
2 parents 7887c37 + 4c4c384 commit 1259287

File tree

4 files changed

+791
-282
lines changed

4 files changed

+791
-282
lines changed

gcloud/bigquery/client.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from gcloud.client import JSONClient
1919
from gcloud.bigquery.connection import Connection
2020
from gcloud.bigquery.dataset import Dataset
21+
from gcloud.bigquery.job import CopyJob
2122
from gcloud.bigquery.job import LoadTableFromStorageJob
2223

2324

@@ -115,3 +116,20 @@ def load_table_from_storage(self, name, destination, *source_uris):
115116
"""
116117
return LoadTableFromStorageJob(name, destination, source_uris,
117118
client=self)
119+
120+
def copy_table(self, name, destination, *sources):
121+
"""Construct a job for copying one or more tables into another table.
122+
123+
:type name: string
124+
:param name: Name of the job.
125+
126+
:type destination: :class:`gcloud.bigquery.table.Table`
127+
:param destination: Table into which data is to be copied.
128+
129+
:type sources: sequence of :class:`gcloud.bigquery.table.Table`
130+
:param sources: tables to be copied.
131+
132+
:rtype: :class:`gcloud.bigquery.job.CopyJob`
133+
:returns: a new ``CopyJob`` instance
134+
"""
135+
return CopyJob(name, destination, sources, client=self)

0 commit comments

Comments
 (0)