prestodb/presto · error · BigQueryException
BIGQUERY_QUERY_FAILED_UNKNOWN
BIGQUERY_QUERY_FAILED_UNKNOWN
Error message
Failed to run the query [%s]
What it means
BigQueryClient.query submits a SQL query to BigQuery via the client library's bigQuery.query call. If the call is interrupted while waiting for results, the code restores the interrupt flag and throws BigQueryException with code BIGQUERY_QUERY_FAILED_UNKNOWN. The query may have actually been accepted by BigQuery; only the wait was interrupted.
Source
Thrown at presto-bigquery/src/main/java/com/facebook/presto/plugin/bigquery/BigQueryClient.java:155
protected Table update(TableInfo table)
{
return bigQuery.update(table);
}
protected Job create(JobInfo jobInfo)
{
return bigQuery.create(jobInfo);
}
protected TableResult query(String sql)
{
try {
return bigQuery.query(QueryJobConfiguration.of(sql));
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new BigQueryException(BIGQUERY_QUERY_FAILED_UNKNOWN.toErrorCode().getCode(), format("Failed to run the query [%s]", sql), e);
}
}
protected String createSql(TableId table, List<String> requiredColumns)
{
String columns = requiredColumns.isEmpty() ? "*" :
requiredColumns.stream().map(column -> format("`%s`", column)).collect(joining(","));
return createFormatSql(table, columns, new String[] {});
}
protected String createFormatSql(TableId table, String requiredColumns, String[] filters)
{
String tableName = fullTableName(table);
String whereClause = createWhereClause(filters)
.map(clause -> "WHERE " + clause)
.orElse("");View on GitHub (pinned to 55bb57d202)
Solutions
- Re-run the query; this error reflects interruption, not necessarily query failure
- Check server logs for what cancelled/interrupted the query (user cancel, timeout setting)
- Increase the query timeout if the query is legitimately long-running and being timed out
- Inspect the BigQuery job history to see if the job completed despite the interruption
Defensive patterns
Strategy: retry
Validate before calling
// No pre-call validation possible for interruption; optionally check thread state:
if (Thread.currentThread().isInterrupted()) {
throw new IllegalStateException("Thread already interrupted; do not start BigQuery query");
} Try / catch
try {
var result = table.query(sql);
} catch (BigQueryException e) {
if ("BIGQUERY_QUERY_FAILED_UNKNOWN".equals(e.getErrorCode().getName()) && e.getCause() instanceof InterruptedException) {
// restore interrupt flag and/or retry with backoff if query should continue
// Thread.currentThread().interrupt();
} else {
throw e;
}
} Prevention
- Increase query timeouts so long BigQuery queries aren't cancelled mid-flight
- Avoid cancelling the Presto task if the query result is needed; instead tune the query
- Use BigQuery job IDs / job history to check whether an interrupted job actually completed
- Handle interruption semantics: respect the interrupt flag rather than immediately retrying
When it happens
Trigger: Executing a BigQuery SQL query when the calling thread is interrupted (query cancellation, shutdown, or Presto's own cancellation mechanism) while blocked on the Google client's API call.
Common situations: Users cancelling long-running queries in Presto; query timeout causing task interruption; coordinator shutdown during a BigQuery query; slow BigQuery job exceeding client wait expectations.
Related errors
- ARROW_FLIGHT_INFO_ERROR
- ARROW_FLIGHT_METADATA_ERROR
- Failed to create Credentials from key
- Failed to create Credentials from file
- BIGQUERY_TABLE_DISAPPEAR_DURING_LIST
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/0ad437c63247a409.
Report an issue: GitHub.