How to clone a dataset to another BigQuery project

一曲冷凌霜 提交于 2019-12-11 05:54:11

问题


Suppose you have a Google-BigQuery project per Client. Now a new Client is coming aboard. What is the best procedure to clone a project, a dataset or an object like a view to a new project?

I have a dataset with a set of views containing analytics logic. It would be great if I could copy those views to the new project.

Thanks


回答1:


as an option - you can have script that

  • take list of all views in your master dataset with Tables: list API
  • loops through all views (check type property) in list response and
    • for each view read with Tables: get API view definition and other relevant properties and
    • then create with Tables: insert API respective view in new dataset

Should be pretty simple




回答2:


We had similar requirement to transfer all or selective Views and Table definitions from One Big Query project to another per Dataset level, Hence have coded in-house to transfer all/selective tables Schemas and Views Definitions using Biq Query APIs. It is shallow cloning(no table data transferred) to destination Big Query project.

Feel free to ask for code example if you still need it. I will be happy to share my Java Code.



来源:https://stackoverflow.com/questions/38490166/how-to-clone-a-dataset-to-another-bigquery-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!