BigQuery dataset was not found in location US

Problem 🔍

Often when you run a query without a qualified object names, BigQuery throws the below error message

Not found: Dataset project-name:Dataset1 was not found in location US 

Solution 💡

#1 Check if the object names have the right case (uppercase / lowercase)

BigQuery object names are case sensitive. So make sure you have used the same case in your SQL query as defined in the database

Example:

SELECT * FROM project-name.dataset2.Employee LIMIT 1000

Rewrite the above query with the right case

SELECT * FROM project-name.Dataset2.Employee LIMIT 1000

#2 Check if you have the right default project name set / chosen in dropdown

Check if you chosen the right default project. From the Web Console, make sure the right project is chosen in the below drop down


In case if you are using the command line tool, use the below command to set the default project:

gcloud config set project project-name

#3 Use a fully qualified object name

Try using a fully qualified name for your objects. eg. Convert the below statement

FROM dataset.tablename

to

FROM `projectname.dataset.tablename`

More Troubleshooting tips ⚡

  • Make sure there is no typo in the dataset / table / project names
  • Check if you sufficient access to query the tables in question

Ryan-Dallas

posted on 05 Feb 19

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds