Reputation: 2698
I'm creating a temporary dataset in bigquery with nodejs client. When I finished my tasks I want to delete this dataset. I'm doing it fairly simple following the code in bigquery documentation.
// Creates a reference to the existing dataset
const dataset = bigquery.dataset(datasetId);
// Deletes the dataset
dataset
.delete()
.then(() => {
console.log(`Dataset ${dataset.id} deleted.`);
})
.catch(err => {
console.error('ERROR:', err);
});
I'm receiving an error: Dataset xxx:5a58b519a3192fa942c57918 is still in use
Upvotes: 2
Views: 245
Reputation: 33765
To help prevent you from unintentionally deleting a dataset that still contains data, you will receive an error unless you first delete and tables and views that it contains. Once you have deleted the tables and views, you will be able to delete the dataset without this error.
Upvotes: 6