Reputation: 1007
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
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
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