civis.io.transfer_table¶
- civis.io.transfer_table(source_db, dest_db, source_table, dest_table, job_name=None, api_key=None, client=None, source_credential_id=None, dest_credential_id=None, polling_interval=None, **advanced_options)[source]¶
Transfer a table from one location to another.
- Parameters
- source_dbstr or int
The name of the database where the source table is located. Optionally, could be the database ID.
- dest_dbstr or int
The name of the database where the table will be transfered. Optionally, could be the database ID.
- source_tablestr
Full name of the table to transfer, e.g.,
'schema.table'
.- dest_tablestr
Full name of the table in the destination database, e.g.,
'schema.table'
.- job_namestr, optional
A name to give the job. If omitted, a random job name will be used.
- api_keyDEPRECATED str, optional
Your Civis API key. If not given, the
CIVIS_API_KEY
environment variable will be used.- client
civis.APIClient
, optional If not provided, an
civis.APIClient
object will be created from theCIVIS_API_KEY
.- source_credential_idstr or int, optional
Optional credential ID for the source database. If
None
, the default credential will be used.- dest_credential_idstr or int, optional
Optional credential ID for the destination database. If
None
, the default credential will be used.- polling_intervalint or float, optional
Number of seconds to wait between checks for job completion.
- **advanced_optionskwargs
Extra keyword arguments will be passed to the import sync job. See
post_syncs()
.
- Returns
- results
CivisFuture
A CivisFuture object.
- results
Examples
>>> transfer_table(source_db='Cluster A', dest_db='Cluster B', ... source_table='schma.tbl', dest_table='schma.tbl')