{"record":{"id":"7ac3454c15b5af97","repo":"apache/beam","slug":"could-convert-schema-for-s","errorCode":null,"errorMessage":"Could convert schema for %s","messagePattern":"Could convert schema for (.+?)","errorType":"validation","errorClass":"SchemaDoesntMatchException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java","lineNumber":1201,"sourceCode":"      }\n\n      // If there are unknown fields, copy them into the output.\n      if (unknownFields != null) {\n        for (int i = cellsToProcess; i < cells.size(); ++i) {\n          // TableCell accepts a null value, but the API client is not annotated.\n          @SuppressWarnings(\"nullness\")\n          TableCell unknownCell = new TableCell().setV(cells.get(i).get(\"v\"));\n          unknownFields.getF().set(i, unknownCell);\n        }\n      }\n\n      if (!collectedExceptions.isEmpty()) {\n        return null;\n      }\n      try {\n        return builder.build();\n      } catch (Exception e) {\n        throw new SchemaDoesntMatchException(\n            \"Could convert schema for \" + schemaInformation.getFullName(), e);\n      }\n    } else {\n      return messageFromMap(\n          schemaInformation,\n          descriptor,\n          tableRow,\n          ignoreUnknownValues,\n          allowMissingRequiredFields,\n          unknownFields,\n          changeType,\n          changeSequenceNum,\n          collectedExceptions);\n    }\n  }\n\n  static TableSchema tableSchemaFromDescriptor(Descriptor descriptor) {\n    List<TableFieldSchema> tableFields =","sourceCodeStart":1183,"sourceCodeEnd":1219,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java#L1183-L1219","documentation":"Same wrap-as-SchemaDoesntMatchException pattern as error 1840 but on the map-based conversion path (messageFromMap / TableRow to proto for map-like rows): the final DynamicMessage could not be built for the given schema, or collected per-field exceptions were rethrown here. The table name is included in the message.","triggerScenarios":"Converting a TableRow (map of field name to value) into the Storage API proto when required proto fields are unset or a nested conversion recorded exceptions, causing builder.build() to throw (e.g. missing required field).","commonSituations":"Rows produced by a different pipeline stage with looser validation; CDC/schema-evolution jobs writing rows against a stale schema; Beam SQL rows cast to TableRows losing nullability information.","solutions":["Inspect the exception cause for the missing/invalid field name.","Ensure all required fields are set before writing the row.","Regenerate the proto descriptor from the current table schema (refresh with StorageApiDynamicDestinations / table schema cache).","Filter or repair bad rows upstream with a validation transform before the sink."],"exampleFix":"// before\nbuilder.build() fails because 'id' is REQUIRED but absent\n// after\nif (row.get(\"id\") == null) { throw new IllegalArgumentException(\"id required\"); } row.set(\"id\", id);","handlingStrategy":"validation","validationCode":"if (!requiredFields.stream().allMatch(f -> row.get(f) != null)) { throw new IllegalArgumentException(\"row missing required fields\"); }","typeGuard":"boolean rowFulfillsRequired(Map<String,Object> row, Descriptor protoDescriptor) { return protoDescriptor.getFields().stream().filter(f -> f.isRequired()).allMatch(f -> row.get(f.getName()) != null); }","tryCatchPattern":"try { builder.build(); } catch (SchemaDoesntMatchException e) { retryWithRepairedSchema(row, e.getCause()); }","preventionTips":["Refresh cached table schema descriptors when the table changes","Validate rows against proto descriptor required fields before writing","Route malformed rows to a dead-letter PCollection instead of failing the pipeline"],"tags":["bigquery","schema","java"],"backgroundTag":"schema-validation-failed","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"}