unytics/bigfunctions

[new]: `copy_table(table_src, table_dest)`

TRKBDO opened this issue · 3 comments

TRKBDO commented

Check the idea has not already been suggested

Edit the title above with self-explanatory function name and argument names

  • The function name and the argument names I entered in the title above seems self explanatory to me.

BigFunction Description as it would appear in the documentation

It would be interesting to leverage a function that copies a source table to a destination table simulating the Bigquery copy command bq cp table_src table_dest

Examples of (arguments, expected output) as they would appear in the documentation

bigfunction.eu.copy_table('project-id.dataset_src.table_id_src', 'project-id.dataset_dest.table_id_dest')

Thanks @TRKBDO for the suggesting.

But maybe the native bigquery copy table function will suit your needs?

https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_table_copy

TRKBDO commented

Thanks @unytics for your quick reply and the proposed solution. But, as it is not mentioned in the documentation you provided, do you think that the statement CREATE TABLE table_dest COPY table_src is eumlating the same zero cost behaviour of the well known BigQuery copy command: bq cp table_src table_dest?

When I execute CREATE TABLE table_dest COPY table_src on my bigquery console, I see that there is NO bytes billed. Si I guess it is the same as bq cp table_src table_dest.

I close the issue.

Don't hesitate if you have any other suggestion.