Finding the query that created a table in BigQuery

风格不统一 提交于 2020-01-06 06:46:16

问题


I am a new employee at the company. The person before me had built some tables in BigQuery. I want to investigate the create table query for that particular table.

Things I would want to check using the query is:

  1. What joins were used?
  2. What are the other tables used to make the table in question?

I have not worked with BigQuery before but I did my due diligence by reading tutorials and the documentation. I could not find anything related there.


回答1:


Brief outline of your actions below:

Step 1 - gather all query jobs of that user using Jobs.list API - you must have Is Owner permission for respective projects to get someone else's jobs

Step 2 - extract only those jobs run by the user you mentioned and referencing your table of interest - using destination table attribute

Step 3 - for those extracted jobs - just simply check respective queries which allow you to learn how that table was populated

Hth!



来源:https://stackoverflow.com/questions/49371881/finding-the-query-that-created-a-table-in-bigquery

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