{"record":{"id":"4eca002dbcd22de4","repo":"apache/beam","slug":"unknown-type-s","errorCode":null,"errorMessage":"Unknown type %s","messagePattern":"Unknown type (.+?)","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/TableRowToStorageApiProto.java","lineNumber":587,"sourceCode":"      // repeated.\n      return resultMode.equals(TableFieldSchema.Mode.REPEATED)\n          ? resultMode\n          : TableFieldSchema.Mode.NULLABLE;\n    }\n  }\n\n  public static String protoModeToJsonMode(TableFieldSchema.Mode protoMode) {\n    String jsonMode = MODE_MAP_PROTO_JSON.get(protoMode);\n    if (jsonMode == null) {\n      throw new RuntimeException(\"Unknown mode \" + protoMode);\n    }\n    return jsonMode;\n  }\n\n  public static String protoTypeToJsonType(TableFieldSchema.Type protoType) {\n    String type = TYPE_MAP_PROTO_JSON.get(protoType);\n    if (type == null) {\n      throw new RuntimeException(\"Unknown type \" + protoType);\n    }\n    return type;\n  }\n\n  public static TableFieldSchema.Type typeToProtoType(String type) {\n    TableFieldSchema.Type protoType = TYPE_MAP_JSON_PROTO.get(type);\n    if (protoType == null) {\n      throw new RuntimeException(\"Unknown type \" + type);\n    }\n    return protoType;\n  }\n\n  public static com.google.api.services.bigquery.model.TableSchema protoSchemaToTableSchema(\n      TableSchema protoTableSchema) {\n    com.google.api.services.bigquery.model.TableSchema tableSchema =\n        new com.google.api.services.bigquery.model.TableSchema();\n    List<com.google.api.services.bigquery.model.TableFieldSchema> tableFields =\n        Lists.newArrayListWithExpectedSize(protoTableSchema.getFieldsCount());","sourceCodeStart":569,"sourceCodeEnd":605,"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#L569-L605","documentation":"protoTypeToJsonType maps a protobuf TableFieldSchema.Type (e.g. STRING, INT64, TIMESTAMP) to the legacy JSON API type string via TYPE_MAP_PROTO_JSON. An unmapped proto type means the map lookup returns null and the method throws RuntimeException(\"Unknown type ...\").","triggerScenarios":"Calling protoTypeToJsonType with a TableFieldSchema.Type missing from TYPE_MAP_PROTO_JSON — typically a type added in a newer BigQuery Storage API than the Beam version supports.","commonSituations":"Schema created by a newer BigQuery client/feature (e.g. new numeric or range types) processed by an older Beam version; converting proto schemas back to JSON TableSchema for display or legacy sinks.","solutions":["Upgrade Beam / google-cloud-bigquery so the type map includes the new type.","Pre-convert the field to a supported type in the source query/schema.","Wrap the conversion and skip/flatten unsupported fields if they are not needed downstream."],"exampleFix":"// before\nString jsonType = TableRowToStorageApiProto.protoTypeToJsonType(unmappedProtoType); // throws\n// after\nif (TYPE_MAP_PROTO_JSON.get(unmappedProtoType) == null) {\n  LOG.warn(\"Skipping unsupported type {}\", unmappedProtoType);\n  return null;\n}","handlingStrategy":"try-catch","validationCode":"for (TableFieldSchema f : schema.getFields()) {\n  if (TableRowToStorageApiProto.typeToProtoType(f.getType()) == null) { /* pre-validate */ }\n}","typeGuard":null,"tryCatchPattern":"try {\n  String jsonType = TableRowToStorageApiProto.protoTypeToJsonType(protoType);\n} catch (RuntimeException e) {\n  LOG.error(\"Proto type {} not mappable; upgrade Beam or change schema\", protoType, e);\n  throw e;\n}","preventionTips":["Upgrade Beam so new BigQuery types are in the proto->JSON type map.","Restrict source schemas to types supported by your Beam version."],"tags":["java","beam","bigquery","schema","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}