{"record":{"id":"2de7da5ae105abfd","repo":"apache/beam","slug":"no-destination-uri-file-count-received","errorCode":null,"errorMessage":"No destination uri file count received.","messagePattern":"No destination uri file count received\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java","lineNumber":2491,"sourceCode":"    }\n  }\n\n  static String getExtractDestinationUri(String extractDestinationDir) {\n    return String.format(\"%s/%s\", extractDestinationDir, \"*.avro\");\n  }\n\n  static List<ResourceId> getExtractFilePaths(String extractDestinationDir, Job extractJob)\n      throws IOException {\n    JobStatistics jobStats = extractJob.getStatistics();\n    List<Long> counts = jobStats.getExtract().getDestinationUriFileCounts();\n    if (counts.size() != 1) {\n      String errorMessage =\n          counts.isEmpty()\n              ? \"No destination uri file count received.\"\n              : String.format(\n                  \"More than one destination uri file count received. First two are %s, %s\",\n                  counts.get(0), counts.get(1));\n      throw new RuntimeException(errorMessage);\n    }\n    long filesCount = counts.get(0);\n\n    ImmutableList.Builder<ResourceId> paths = ImmutableList.builder();\n    ResourceId extractDestinationDirResourceId =\n        FileSystems.matchNewResource(extractDestinationDir, true /* isDirectory */);\n    for (long i = 0; i < filesCount; ++i) {\n      ResourceId filePath =\n          extractDestinationDirResourceId.resolve(\n              String.format(\"%012d%s\", i, \".avro\"),\n              ResolveOptions.StandardResolveOptions.RESOLVE_FILE);\n      paths.add(filePath);\n    }\n    return paths.build();\n  }\n\n  /////////////////////////////////////////////////////////////////////////////\n","sourceCodeStart":2473,"sourceCodeEnd":2509,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java#L2473-L2509","documentation":"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.","triggerScenarios":"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.","commonSituations":"Upstream extract job produced no files; runner side-input delivery issues; misconfigured dynamic destinations producing multiple counts where code expects one.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Map<ResourceId, Long> counts = /* side input results */;\nif (counts == null || counts.size() != 1) {\n  throw new IllegalStateException(\n      \"Expected exactly one destination file count, got: \" + (counts == null ? \"none\" : counts.size()));\n}","preventionTips":["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"],"tags":["bigquery","file-loads","side-input","java"],"backgroundTag":"empty-result-set","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}