# BigQuery Error Messages: Causes and Fixes | Masthead

51 BigQuery error messages explained: what each one means, why it happens and how to fix it, from "Resources exceeded" and quota errors to permissions, DML conflicts and failed loads.

> For the index of this section of the site, see [llms.txt](https://mastheadata.com/llms.txt)

BigQuery troubleshooting

# BigQuery error messages and how to fix them

Paste the start of your error into the filter. Each page has the exact message, the usual causes, fixes you can run, and how to stop it from coming back.

No page for that message yet. Check the [SQL reference](https://mastheadata.com/bigquery/sql.md), or ask us at [team@mastheadata.com](mailto:team@mastheadata.com).

## Query and syntax errors

*   [Aggregate function not allowed in WHERE clauseAn aggregate such as SUM, COUNT or MAX is used in WHERE, which filters rows before they are grouped.](https://mastheadata.com/bigquery/errors/aggregate-function-not-allowed-in-where.md)
*   [Analytic function not allowed in WHERE clauseA window (analytic) function such as ROW\NUMBER, RANK or LAG is used in WHERE, which is evaluated before window functions.](https://mastheadata.com/bigquery/errors/analytic-function-not-allowed-in-where.md)
*   [Cannot query over table without a filter for partition eliminationThe table has require\partition\filter enabled, a cost guardrail that rejects any query that would read every partition.](https://mastheadata.com/bigquery/errors/cannot-query-without-partition-filter.md)
*   [Column name is ambiguousThe query reads two or more tables, subqueries or UNNEST results that all have a column with this name, and the reference doesn't say which one.](https://mastheadata.com/bigquery/errors/column-name-is-ambiguous.md)
*   [Correlated subqueries that reference other tables are not supportedA subquery reads another table and refers to a column of the outer query, and BigQuery couldn't rewrite it into a join.](https://mastheadata.com/bigquery/errors/correlated-subqueries-not-supported.md)
*   [No matching signature for functionA function was called with argument types that none of its signatures accept, for example DATE\DIFF with a DATE and a TIMESTAMP, or SUBSTR on an INT64.](https://mastheadata.com/bigquery/errors/no-matching-signature-for-function.md)
*   [No matching signature for operatorAn operator such as =, <, >= or IN got two values of types BigQuery won't compare or combine implicitly: STRING vs INT64, DATE vs TIMESTAMP, DATETIME vs TIMESTAMP.](https://mastheadata.com/bigquery/errors/no-matching-signature-for-operator.md)
*   [Scalar subquery produced more than one elementA subquery used as a single value, in SELECT, WHERE or SET, returned two or more rows at run time.](https://mastheadata.com/bigquery/errors/scalar-subquery-produced-more-than-one-element.md)
*   [SELECT list expression references column which is neither grouped nor aggregatedThe query has GROUP BY or an aggregate function, and a selected column is neither in GROUP BY nor inside an aggregate, so BigQuery can't pick one value per group.](https://mastheadata.com/bigquery/errors/column-neither-grouped-nor-aggregated.md)
*   [Syntax error: Expected end of input but gotThe parser read a complete statement and then found more text it can't attach to it: a second statement without a semicolon, LIMIT before ORDER BY, ORDER BY before UNION ALL, or syntax from another dialect such as SELECT TOP.](https://mastheadata.com/bigquery/errors/syntax-error-expected-end-of-input.md)
*   [Syntax error: Unexpected keywordThe parser reached a reserved keyword where it can't be used: most often a reserved word used as a column, alias or table name (END, ORDER, GROUP, RANGE, ROWS, HASH...), or a clause written in the wrong place.](https://mastheadata.com/bigquery/errors/syntax-error-unexpected-keyword.md)
*   [Table must be qualified with a datasetThe query names a table without its dataset, and the job has no default dataset to resolve it.](https://mastheadata.com/bigquery/errors/table-name-missing-dataset.md)
*   [The query is too largeThe SQL text is longer than BigQuery's limit of 1,024K characters, counting comments and whitespace.](https://mastheadata.com/bigquery/errors/query-too-large.md)
*   [Unrecognized nameA column, alias or range variable in the query doesn't exist in the scope where it is used.](https://mastheadata.com/bigquery/errors/unrecognized-name.md)

## Resources and limits

*   [Not enough resources for query planningAfter BigQuery expanded every view, WITH clause and SQL UDF, the query plan was too big to build.](https://mastheadata.com/bigquery/errors/query-too-complex.md)
*   [Operation timed out after 6.0 hoursA BigQuery query or statement can run for at most 6 hours.](https://mastheadata.com/bigquery/errors/job-timed-out.md)
*   [Query exceeded limit for bytes billedBigQuery estimated, before running the query, that it would bill more bytes than the job's maximum bytes billed setting allows, so it refused to start.](https://mastheadata.com/bigquery/errors/query-exceeded-limit-for-bytes-billed.md)
*   [Query exceeded resource limits (CPU per bytes billed)On-demand pricing charges by bytes scanned, so BigQuery caps how much CPU a query may burn per byte: about 256 CPU seconds per MiB scanned.](https://mastheadata.com/bigquery/errors/query-exceeded-resource-limits.md)
*   [Resources exceeded during query executionOne stage of the query needed more memory than a single BigQuery worker has.](https://mastheadata.com/bigquery/errors/resources-exceeded-during-query-execution.md)
*   [Response too large to returnThe query result, or one stage of the query, is bigger than the maximum response size (10 GB compressed for results written to the temporary table).](https://mastheadata.com/bigquery/errors/response-too-large.md)

## Quotas and rate limits

*   [Custom quota exceeded: QueryUsagePerDayAn administrator capped how many bytes on-demand queries may process per day, and the project (QueryUsagePerDay) or your user (QueryUsagePerUserPerDay) hit that cap.](https://mastheadata.com/bigquery/errors/custom-quota-exceeded.md)
*   [Exceeded rate limits: too many api requests per user per methodOne user or service account called the same BigQuery API method too fast.](https://mastheadata.com/bigquery/errors/too-many-api-requests-per-user-per-method.md)
*   [Exceeded rate limits: too many table update operationsSomething updates one table's metadata faster than BigQuery allows: 5 operations per 10 seconds for a standard table, 50 for a partitioned one.](https://mastheadata.com/bigquery/errors/too-many-table-update-operations.md)
*   [Quota exceeded: free query bytes scannedYour project has no billing account (BigQuery sandbox) and has used its free monthly query allowance of 1 TiB processed.](https://mastheadata.com/bigquery/errors/quota-exceeded-free-query-bytes.md)
*   [Quota exceeded: imports or query appends per tableOne table received too many load, copy or query append/overwrite jobs: the limit is 1,500 table modifications per table per day, enforced as a rate throughout the day.](https://mastheadata.com/bigquery/errors/quota-exceeded-imports-per-table.md)
*   [Quota exceeded: max number of jobs that can be queued per projectThe project's query queue in this region is full: BigQuery queues at most 1,000 interactive and 20,000 batch queries per project per region, and rejects the next one.](https://mastheadata.com/bigquery/errors/quota-exceeded-queued-jobs.md)
*   [Quota exceeded: partition modifications to a column partitioned tableJobs touched too many partitions of one column-partitioned table today: the limit is 30,000 partition modifications per table per day, and a job that rewrites 1,000 daily partitions uses 1,000.](https://mastheadata.com/bigquery/errors/quota-exceeded-partition-modifications.md)
*   [Too many DML statements outstanding against tableMore than 20 UPDATE, DELETE, MERGE or TRUNCATE TABLE statements are already queued for one table, so BigQuery rejects the next one.](https://mastheadata.com/bigquery/errors/too-many-dml-statements-outstanding.md)

## Permissions and access

*   [BigQuery API has not been used in project before or it is disabledThe project your request is billed to doesn't have the BigQuery API enabled.](https://mastheadata.com/bigquery/errors/bigquery-api-not-enabled.md)
*   [Billing has not been enabled for this projectThe project runs in the BigQuery sandbox (no billing account), and you used a feature the sandbox doesn't offer: here DML (INSERT, UPDATE, DELETE, MERGE).](https://mastheadata.com/bigquery/errors/billing-not-enabled.md)
*   [Permission bigquery.tables.get denied on tableThe caller asked for a table's metadata (schema, size, existence) without the bigquery.tables.get permission, or the table isn't there.](https://mastheadata.com/bigquery/errors/permission-bigquery-tables-get-denied.md)
*   [Permission denied while getting Drive credentialsA query touched a Google Sheets or Drive external table, and the credentials running it can't read the file in Drive: either they lack the Drive OAuth scope or the file isn't shared with that identity.](https://mastheadata.com/bigquery/errors/permission-denied-drive-credentials.md)
*   [User does not have bigquery.jobs.create permissionYou tried to run a job in a project where you can't create jobs.](https://mastheadata.com/bigquery/errors/user-does-not-have-bigquery-jobs-create.md)
*   [User does not have permission to query table, or perhaps it does not existThe job runs, but the identity running it can't read one of the tables or views it references, or the table doesn't exist under that name and location.](https://mastheadata.com/bigquery/errors/access-denied-permission-to-query-table.md)

## Not found and location

*   [Already Exists: TableThe job tried to create a table that already exists: a plain CREATE TABLE, an API insert, or a write with WRITE\EMPTY into a table that has data.](https://mastheadata.com/bigquery/errors/already-exists-table.md)
*   [Cannot read and write in different locationsThe job reads data in one location and writes the result to a dataset in another, and a BigQuery job can't cross locations.](https://mastheadata.com/bigquery/errors/cannot-read-and-write-in-different-locations.md)
*   [Dataset was not found in locationBigQuery looked for the dataset in the project and location the job runs in and didn't find it.](https://mastheadata.com/bigquery/errors/dataset-not-found-in-location.md)
*   [Table was not found in locationThe table in the query doesn't exist under that exact project, dataset and name in the job's location.](https://mastheadata.com/bigquery/errors/table-not-found.md)

## DML and concurrency

*   [Could not serialize access to table due to concurrent updateTwo mutating DML statements (UPDATE, DELETE or MERGE) tried to change the same partition of a table at the same time.](https://mastheadata.com/bigquery/errors/could-not-serialize-access-concurrent-update.md)
*   [UPDATE or DELETE statement would affect rows in the streaming bufferYour UPDATE, DELETE or MERGE targets rows that were streamed in recently with the legacy insertAll API (now called Storage Write API REST) and are still in the streaming buffer.](https://mastheadata.com/bigquery/errors/dml-over-streaming-buffer.md)
*   [UPDATE/MERGE must match at most one source row for each target rowYour MERGE or UPDATE ...](https://mastheadata.com/bigquery/errors/update-merge-must-match-at-most-one-source-row.md)

## Loading and schema

*   [Array cannot have a null elementBigQuery can use arrays containing NULL inside a query, but it can't return or store them.](https://mastheadata.com/bigquery/errors/array-cannot-have-null-element.md)
*   [CSV table encountered too many errors, giving upA CSV load job (or CSV external table) hit more bad rows than max\bad\records allows, 0 by default, so nothing was written.](https://mastheadata.com/bigquery/errors/csv-table-encountered-too-many-errors.md)
*   [JSON table encountered too many errors, giving upA JSON load job (or a JSON external table) hit more bad rows than max\bad\records allows, 0 by default, so nothing was loaded.](https://mastheadata.com/bigquery/errors/json-table-encountered-too-many-errors.md)
*   [Provided Schema does not match TableA load, query append, copy or schema update sent a schema that conflicts with the table, most often a column whose type changed.](https://mastheadata.com/bigquery/errors/provided-schema-does-not-match-table.md)

## Data and type conversion

*   [Array index is out of boundsYou read an array position that doesn't exist, for example element 3 of a 2-element array, typically SPLIT(...)\[OFFSET(2)\] on a string with fewer parts than expected.](https://mastheadata.com/bigquery/errors/array-index-out-of-bounds.md)
*   [Bad int64 valueCAST(...](https://mastheadata.com/bigquery/errors/bad-int64-value.md)
*   [Could not cast literal to typeA string literal in your SQL is compared with or passed to a DATE, DATETIME, TIME or TIMESTAMP, and it isn't a valid value of that type, such as "2024-02-30" or "01/15/2024".](https://mastheadata.com/bigquery/errors/could-not-cast-literal.md)
*   [division by zeroA division in your query hit a zero denominator, and in BigQuery that fails the whole query instead of returning NULL.](https://mastheadata.com/bigquery/errors/division-by-zero.md)
*   [Failed to parse input stringPARSE\DATE, PARSE\DATETIME or PARSE\TIMESTAMP got a string that doesn't match the format you passed, typically extra characters (a time after a date), a missing part, or a T where the format has a space.](https://mastheadata.com/bigquery/errors/failed-to-parse-input-string.md)
*   [Integer Overflow (INT64)An INT64 calculation went past the type's range (about 9.22 quintillion either way), and BigQuery fails the query instead of wrapping around.](https://mastheadata.com/bigquery/errors/int64-overflow.md)
---

## Other pages in BigQuery Reference

> For the full index of this section, see [BigQuery Reference](https://mastheadata.com/llms/llms-bigquery-reference.txt).

- [BigQuery Aggregate Functions: COUNT, SUM, STRING_AGG and More | Masthead](https://mastheadata.com/bigquery/aggregate-functions.md): Aggregate functions collapse many rows into one value per group. 16 aggregate functions with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Array Functions: UNNEST, ARRAY_AGG and More | Masthead](https://mastheadata.com/bigquery/array-functions.md): ARRAY is a first-class type in BigQuery: nested and repeated fields are how BigQuery avoids joins. 11 array functions with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Conditional Expressions: CASE, IF, COALESCE, IFNULL | Masthead](https://mastheadata.com/bigquery/conditional-expressions.md): Conditional expressions choose a value based on a condition or on NULLs. 5 conditional expressions with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Conversion Functions: CAST and SAFE_CAST | Masthead](https://mastheadata.com/bigquery/conversion-functions.md): Conversion functions change a value from one type to another. 3 conversion functions with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Cost Queries: SQL to Find and Cut BigQuery Spend | Masthead](https://mastheadata.com/bigquery/cost-queries.md): 20 ready-to-run SQL queries for BigQuery cost: the most expensive queries, cost by user, project, label, dbt model and dashboard, slot usage, storage cost, unused and dead-end tables.
- [BigQuery Date Functions: Syntax, Examples and Gotchas | Masthead](https://mastheadata.com/bigquery/date-functions.md): DATE functions in BigQuery (GoogleSQL) build, shift, truncate, compare and format calendar dates. 14 date functions with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Datetime Functions: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/datetime-functions.md): DATETIME is a civil date and time with no time zone: what a wall clock shows. 8 datetime functions with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery DDL: CREATE TABLE, Partitioning, Clustering and Views | Masthead](https://mastheadata.com/bigquery/ddl.md): Data definition language creates and changes tables, views, materialized views and functions. 8 DDL statements with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery DML: INSERT, UPDATE, DELETE and MERGE | Masthead](https://mastheadata.com/bigquery/dml.md): Data manipulation language changes table rows. 5 DML statements with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Functions List: Syntax and Examples for Every Function | Masthead](https://mastheadata.com/bigquery/functions.md): All 143 BigQuery SQL functions we cover, by category: date, timestamp, string, array, JSON, aggregate, window and more. Each with syntax, runnable examples, common mistakes and cost notes.
- [GA4 BigQuery Export: SQL Queries for Sessions, Users, Events and Revenue | Masthead](https://mastheadata.com/bigquery/ga4.md): 28 SQL recipes for the GA4 BigQuery export: unnest event_params, sessions, users, traffic sources, engagement, ecommerce, retention, and how to keep the queries cheap. Every one runs on Google's public GA4 sample.
- [BigQuery INFORMATION_SCHEMA: Jobs, Tables, Storage and Costs | Masthead](https://mastheadata.com/bigquery/information-schema-views.md): INFORMATION_SCHEMA views expose BigQuery metadata as tables you can query: jobs, slots, bytes billed, tables, columns and storage. 2 INFORMATION_SCHEMA with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery JSON Functions: JSON_VALUE, JSON_QUERY and More | Masthead](https://mastheadata.com/bigquery/json-functions.md): BigQuery reads JSON stored as STRING or as the native JSON type. 14 JSON functions with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Math Functions: ROUND, SAFE_DIVIDE, MOD and More | Masthead](https://mastheadata.com/bigquery/math-functions.md): Mathematical functions round, divide, bucket and transform numbers. 15 mathematical functions with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Pricing Calculator: On-Demand vs Editions and Storage | Masthead](https://mastheadata.com/bigquery/pricing-calculator.md): Free BigQuery pricing calculator: compare on-demand ($6.25 per TiB) with Standard, Enterprise and Enterprise Plus editions per slot-hour, and logical vs physical storage billing, using your own numbers from INFORMATION_SCHEMA.
- [BigQuery Pricing Explained (2026): On-Demand, Editions and Storage | Masthead](https://mastheadata.com/bigquery/pricing.md): BigQuery bills compute and storage separately. Compute is on-demand at $6.25 per TiB scanned (the first 1 TiB a month is free) or capacity-based with editions from $0.04 per slot-hour. Storage costs $0.02 per GiB a month for active data and $0.01 for data unchanged for 90 days (US, logical).
- [BigQuery Public Datasets: Sizes, Tables and What They Cost to Query | Masthead](https://mastheadata.com/bigquery/public-datasets.md): 40 BigQuery public datasets with their real table sizes and what querying them costs: GitHub, Stack Overflow, Wikipedia, Google Trends, GA4 sample, NOAA weather, taxi trips, crypto and more, with cheap example queries.
- [BigQuery Query Syntax: QUALIFY, PIVOT, CTEs, JOINs and More | Masthead](https://mastheadata.com/bigquery/query-syntax.md): The clauses that shape a GoogleSQL query in BigQuery: CTEs, joins, set operations, PIVOT, QUALIFY and SELECT * EXCEPT. 11 query syntax with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Scripting: Variables, Loops, Dynamic SQL, LOAD and EXPORT | Masthead](https://mastheadata.com/bigquery/scripting.md): Multi-statement queries let you declare variables, loop, branch and build SQL at run time, and LOAD DATA and EXPORT DATA move data in and out of BigQuery from SQL.. 5 scripting and data movement with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery SQL Syntax: Statements, Clauses, DDL and DML | Masthead](https://mastheadata.com/bigquery/sql.md): BigQuery SQL syntax reference: QUALIFY, PIVOT, MERGE, CTEs, partitioned and clustered tables, scripting and INFORMATION_SCHEMA. 31 statements and clauses with examples and cost notes.
- [BigQuery String Functions: Syntax and Examples | Masthead](https://mastheadata.com/bigquery/string-functions.md): String functions in BigQuery split, search, replace, pad and format STRING values, and most also accept BYTES. 28 string functions with syntax, runnable examples, common mistakes and cost notes.
- [The Bill Is Right: Guess Your BigQuery Bill | Masthead](https://mastheadata.com/bigquery/the-bill-is-right.md): A free game show for data teams. Guess the monthly BigQuery bill from real Google Cloud list prices: three tries, land within 15% to win.
- [BigQuery Timestamp Functions: Syntax, Time Zones and Examples | Masthead](https://mastheadata.com/bigquery/timestamp-functions.md): TIMESTAMP is an absolute point in time with microsecond precision, stored in UTC. 12 timestamp functions with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Hash and Utility Functions: FARM_FINGERPRINT, UUID, SHA256 | Masthead](https://mastheadata.com/bigquery/utility-functions.md): Hashing, unique IDs and a few utility functions that show up in pipelines: deterministic sampling, surrogate keys, deduplication and raising your own errors.. 6 hash and utility functions with syntax, runnable examples, common mistakes and cost notes.
- [BigQuery Window Functions: ROW_NUMBER, LAG, RANK and More | Masthead](https://mastheadata.com/bigquery/window-functions.md): Window (analytic) functions compute a value for every row from a window of related rows, defined with OVER (PARTITION BY ... 11 window functions with syntax, runnable examples, common mistakes and cost notes.
