bigrquery (version 0.3.0)

copy_table: Copy one or more source tables to a destination table.

Description

Each source table and the destination table should be table references, that is, lists with exactly three entries: project_id, dataset_id, and table_id.

Usage

copy_table(src, dest, create_disposition = "CREATE_IF_NEEDED",
  write_disposition = "WRITE_EMPTY", project = NULL)

Arguments

src

either a single table reference, or a list of table references

dest

destination table

create_disposition

behavior for table creation if the destination already exists. defaults to "CREATE_IF_NEEDED", the only other supported value is "CREATE_NEVER"; see the API documentation for more information

write_disposition

behavior for writing data if the destination already exists. defaults to "WRITE_EMPTY", other possible values are "WRITE_TRUNCATE" and "WRITE_APPEND"; see the API documentation for more information

project

project ID to use for the copy job. defaults to the project of the destination table.

See Also

API documentation: https://cloud.google.com/bigquery/docs/tables#copyingtable

Examples

Run this code

src <- list(project_id = "publicdata", dataset_id = "samples", table_id = "shakespeare")
dest <- list(project_id = "myproject", dataset_id = "mydata", table_id = "shakespeare")
doubled <- dest
doubled$table_id <- "double_shakespeare"
copy_table(src, dest)
copy_table(list(src, dest), doubled)

Run the code above in your browser using DataLab