prestodb/presto · error · PrestoException
BIGQUERY_FAILED_TO_EXECUTE_QUERY
BIGQUERY_FAILED_TO_EXECUTE_QUERY
Error message
Failed to compute empty projection
What it means
BigQuerySplitManager.createEmptyProjection builds splits for queries with no columns (e.g. SELECT count(*)) by generating empty-projection splits; any BigQueryException during that computation is rethrown as BIGQUERY_FAILED_TO_EXECUTE_QUERY with this message. It means the connector failed while planning/sizing the empty-projection splits.
Source
Thrown at presto-bigquery/src/main/java/com/facebook/presto/plugin/bigquery/BigQuerySplitManager.java:133
String sql = bigQueryClient.createFormatSql(tableId, "COUNT(*)", new String[] {filter.get()});
TableResult result = bigQueryClient.query(sql);
numberOfRows = result.iterateAll().iterator().next().get(0).getLongValue();
}
else {
// no filters, so we can take the value from the table info
numberOfRows = bigQueryClient.getTable(tableId).getNumRows().longValue();
}
long rowsPerSplit = numberOfRows / actualParallelism;
long remainingRows = numberOfRows - (rowsPerSplit * actualParallelism); // need to be added to one of the split due to integer division
List<BigQuerySplit> splits = range(0, actualParallelism)
.mapToObj(ignored -> BigQuerySplit.emptyProjection(rowsPerSplit))
.collect(toList());
splits.set(0, BigQuerySplit.emptyProjection(rowsPerSplit + remainingRows));
return splits;
}
catch (BigQueryException e) {
throw new PrestoException(BIGQUERY_FAILED_TO_EXECUTE_QUERY, "Failed to compute empty projection", e);
}
}
}
View on GitHub (pinned to 55bb57d202)
Solutions
- Look at the wrapped BigQueryException cause for the root reason and address it (permissions, quota, table existence)
- Verify the table still exists and the service account has access
- Retry the query if the cause was transient
- Check BigQuery API quotas and error details in Google Cloud logs
Defensive patterns
Strategy: try-catch
Validate before calling
// before empty-projection queries, verify table access
Table table = bigQueryClient.getTable(tableId);
if (table == null) {
throw new IllegalStateException("Table not found or not accessible: " + tableId);
} Try / catch
try {
return splitManager.getSplits(...);
} catch (PrestoException e) {
if (BIGQUERY_FAILED_TO_EXECUTE_QUERY.getCode() == e.getErrorCode().getCode()) {
log.error("Empty projection failed; cause: %s", e.getCause());
// address cause (permissions/quota/table existence) then retry
}
throw e;
} Prevention
- Grant the service account stable access to all queried tables
- Monitor BigQuery quotas for rate-limit errors
- Avoid rapid metadata re-checks on dropping/renaming tables
- Always log the wrapped cause to identify the root BigQuery error
When it happens
Trigger: Running a query with an empty projection (e.g. SELECT COUNT(*) FROM table) when the split computation against BigQuery metadata throws a BigQueryException (API errors, missing table, quota).
Common situations: Table dropped/renamed between metadata fetch and split computation; BigQuery API quota/rate limits; permission revocations; transient API outages.
Related errors
- UNEXPECTED_ACCUMULO_ERROR
- BIGQUERY_QUERY_FAILED_UNKNOWN
- 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/ceab0f266aa5d3af.
Report an issue: GitHub.