apache/beam · error · RuntimeException
No destination uri file count received.
Error message
No destination uri file count received.
What it means
Thrown when consolidating per-destination file counts produced by the BigQuery extract/write job: the map of destination-uri to file count is empty (no counts received) or has more than one entry, which the load step cannot handle.
Solutions
- Check that the extract stage produced temp files in the extractDestinationDir
- Retry the job — empty side inputs are often transient runner issues
- Verify dynamic destination configuration so each destination receives exactly one count
- Check Beam issue tracker / upgrade Beam version for known load-consolidation bugs
Defensive patterns
Strategy: try-catch
Try / catch
Map<ResourceId, Long> counts = /* side input results */;
if (counts == null || counts.size() != 1) {
throw new IllegalStateException(
"Expected exactly one destination file count, got: " + (counts == null ? "none" : counts.size()));
} Prevention
- Ensure the extract stage actually writes temp files before the load stage consumes counts
- Verify dynamic-destination configuration maps each destination exactly once
- Use a stable Beam version; empty side-input delivery bugs are often runner-specific
When it happens
Trigger: After a batch BigQuery write (FILE_LOADS/EXPORT path), the count of temp files per destination URI arrives via a side input but is empty or contains multiple entries where exactly one is expected.
Common situations: Upstream extract job produced no files; runner side-input delivery issues; misconfigured dynamic destinations producing multiple counts where code expects one.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- A function must be provided to convert the input type into…
- Attempted to get side input window for GlobalWindow from…
- Attempted to get side input window for GlobalWindow from…
- BigQuery %1$s not found for table "%2$s" . Please create…
- BigQuery data contained value
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/2de7da5ae105abfd.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java:2491
}
}
static String getExtractDestinationUri(String extractDestinationDir) {
return String.format("%s/%s", extractDestinationDir, "*.avro");
}
static List<ResourceId> getExtractFilePaths(String extractDestinationDir, Job extractJob)
throws IOException {
JobStatistics jobStats = extractJob.getStatistics();
List<Long> counts = jobStats.getExtract().getDestinationUriFileCounts();
if (counts.size() != 1) {
String errorMessage =
counts.isEmpty()
? "No destination uri file count received."
: String.format(
"More than one destination uri file count received. First two are %s, %s",
counts.get(0), counts.get(1));
throw new RuntimeException(errorMessage);
}
long filesCount = counts.get(0);
ImmutableList.Builder<ResourceId> paths = ImmutableList.builder();
ResourceId extractDestinationDirResourceId =
FileSystems.matchNewResource(extractDestinationDir, true /* isDirectory */);
for (long i = 0; i < filesCount; ++i) {
ResourceId filePath =
extractDestinationDirResourceId.resolve(
String.format("%012d%s", i, ".avro"),
ResolveOptions.StandardResolveOptions.RESOLVE_FILE);
paths.add(filePath);
}
return paths.build();
}
/////////////////////////////////////////////////////////////////////////////
View on GitHub (pinned to 12126d8942)