BigQuery error messages
40 BigQuery error messages, each with what it means, the smallest query that reproduces it and how to fix it. Every message was produced on BigQuery, so the text matches what you see.
Practice this in a free lesson on learn.querylab.io: Read the error and fix the query.
Each page below starts with the exact text BigQuery prints, produced by running the query on the page. Then it explains what BigQuery is objecting to, gives the smallest query that fails the same way, and lists the fixes. Most of them also say which variants of the message exist and which similar-looking errors mean something else.
Looking for a short overview instead? Common BigQuery errors covers the most frequent ones on one page.
To practise reading a message and fixing the query, try the free lessonRead the error and fix the query on learn.querylab.io. It runs in your browser.
Syntax
- Syntax error: Unexpected identifier BigQuery says "Unexpected identifier" when a word turns up where a statement had to start.
- Syntax error: Unexpected keyword BigQuery found a reserved word where a name, an expression or a clause had to be.
- Syntax error: Expected X but got Y BigQuery was in the middle of a construct and the next token was not one it could accept.
- Syntax error: Expected keyword MODULE or keyword PROTO This is what BigQuery says when the first word of your query is import.
- Syntax error: WHERE not supported after FROM query A query that starts with FROM is a pipe query, and a bare WHERE cannot follow it.
- Syntax error: Expected end of input but got keyword BigQuery read a complete statement and then found more text.
Names
- Not found: Table was not found in location BigQuery says a table was not found only when it was willing to look.
- Not found: Dataset was not found in location The location at the end of this message is where the job ran, not where the dataset is.
- Unrecognized name BigQuery found a name that is not a column, alias or table in scope at that point of the query.
- Column name X is ambiguous Two tables in the FROM clause, or two columns with one alias, have the same name, and BigQuery will not choose between them.
- Table "x" must be qualified with a dataset BigQuery reads a table name with no dataset as a table in the default dataset, and there is none.
- Invalid field name "x". Fields must contain the allowed characters BigQuery refuses a column name with a dot, a dollar sign or a few other characters, one over 300 characters, or one that starts with a reserved prefix such as _PARTITION.
- Function not found: X BigQuery has no function with that name where it looked.
- Duplicate column names in the result are not supported A plain query may return two columns with the same name and BigQuery renames the second one.
Grouping
- SELECT list expression references column which is neither grouped nor aggregated Once a query has a GROUP BY, every column has to be either grouped or inside an aggregate.
- Column of type ARRAY containing JSON cannot be used in SELECT DISTINCT BigQuery now groups plain arrays, so this message means the array holds JSON or GEOGRAPHY.
Types
- No matching signature for operator BigQuery will not compare a number to a string, not even a string literal.
- No matching signature for function A function was called with arguments of the wrong type or the wrong number.
- Cannot access field on a value with type ARRAY You wrote array.field, but a dot only reaches into a STRUCT, and the column is a repeated one.
- Values referenced in UNNEST must be arrays UNNEST takes an array and turns it into rows.
- Queries in UNION ALL have mismatched column count Every query in a UNION, INTERSECT or EXCEPT must return the same number of columns, matched by position.
Subqueries
- Scalar subquery produced more than one element A subquery used as a single value returned two or more rows.
- Correlated subqueries that reference other tables are not supported BigQuery turns a correlated subquery into a join.
Data values
- Bad int64 value A CAST turned a string into a number, date or timestamp and one value did not fit.
- Failed to parse input string A PARSE_DATE, PARSE_TIMESTAMP, PARSE_DATETIME or PARSE_TIME call got a string that does not fit its format.
- Integer Overflow A result did not fit its type, so BigQuery stopped the query.
- Array cannot have a null element; error in writing field X An array with a NULL in it can live inside a query, but it cannot be returned, saved or read from a view.
- Cannot parse regular expression: X BigQuery uses the RE2 engine for regular expressions.
- CSV or JSON table encountered too many errors, giving up A load job, or a query over an external table, found more bad rows than it may skip.
- division by zero: X / 0 The / operator fails the whole query when one row has a divisor of 0.
DML
- UPDATE/MERGE must match at most one source row for each target row A row of the table being updated matched more than one row of the source, so BigQuery has no way to choose which value to write.
Cost
- Cannot query over table without a filter over columns that can be used for partition elimination The table has require_partition_filter set, so BigQuery refuses any query that cannot prune partitions before reading.
- Quota exceeded: Your project exceeded quota for free query bytes scanned You used the 1 TiB of free monthly query processing and the account has no paid billing attached.
Resources
- Resources exceeded during query execution: The query could not be executed in the allotted memory A single worker ran out of memory because of the shape of the query, which has nothing to do with how many bytes it reads.
- Response too large to return The result of the query is larger than the response size BigQuery allows, which the quotas page puts at 10 GB compressed.
- Exceeded rate limits: too many table update operations for this table A table accepts a few metadata updates every 10 seconds, counting loads, copies, DDL and queries that write to it.
- An internal error occurred and the request could not be completed BigQuery failed on its own side and says so with HTTP 500 and the reason internalError.
Permissions
- Access Denied: User does not have permission to query table BigQuery sends this one message for a missing permission, a misspelled dataset, a dataset in the wrong case and a project that does not exist.
- Access Denied: neither fine-grained reader nor masked get permission A column in the query has a policy tag and you hold no role on it.
- Cannot be used with STANDARD edition A Standard reservation refuses a table that has a policy tag, a masking rule or a row access policy, and refuses BigQuery ML and search indexes.