Febian Shah
Febian Shah

Reputation: 1007

Bigquery Dataset/Table's metadata

Is there a way to programmatically (Java API) get Bigquery's table and dataset metadata?

I was trying to create a report on the size, creator, creation time of each tables/datasets and want to avoid doing it manually. We have a lot of tables.

Upvotes: 3

Views: 5961

Answers (2)

Yonihu
Yonihu

Reputation: 171

regarding getting the table metadata, with java you can do it like this

Tables tableRequest = bigquery.tables();
Table table =     tableRequest.get(projectName,datasetName,tableName).execute();
List<TableFieldSchema> fields = table.getSchema().getFields();

contact me if you have any more questions. i worked alot with big query table schema

Upvotes: 1

Febian Shah
Febian Shah

Reputation: 1007

Thanks N.N. This worked:

SELECT dataset_id, table_id, size_bytes FROM <<>>.TABLES WHERE size_bytes > 0 order by size_bytes desc

Anyway to get created_by?

Upvotes: 3

Related Questions