Want to see all the tables and views in a specific BigQuery dataset?
Just run this from your terminal using the bq command-line tool:
To list tables and views in a specific project and dataset:
bq ls your_project_id.your_dataset_name
To list tables and views in a default project:
bq ls your_dataset_name
$bq ls test_dataset
tableId Type Labels Time Partitioning Clustered Fields
----------------------------- ------- --------------- ------------------- ------------------
employee_by_department_view VIEW department:hr
employees
Use --format=prettyjson or --format=csv for programmatic processing!
bq --format=prettyjson ls test_dataset
$bq --format=prettyjson ls test_dataset
[
{
"creationTime": "1743953312779",
"id": "demo-project:test_dataset.employee_by_department_view",
"kind": "bigquery#table",
"labels": {
"department": "hr"
},
"tableReference": {
"datasetId": "test_dataset",
"projectId": "demo-project",
"tableId": "employee_by_department_view"
},
"type": "VIEW",
"view": {
"useLegacySql": false
}
},
{
"creationTime": "1743946340766",
"id": "demo-project:test_dataset.employees",
"kind": "bigquery#table",
"tableReference": {
"datasetId": "test_dataset",
"projectId": "demo-project",
"tableId": "employees"
},
"type": "TABLE"
}
]
Previous Next Home
No comments:
Post a Comment