{"record":{"id":"7bce6952e37b3451","repo":"apache/beam","slug":"unable-to-parse-field-with-type-s","errorCode":null,"errorMessage":"Unable to parse field with type %s","messagePattern":"Unable to parse field with type (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/SpannerChangestreamsReadSchemaTransformProvider.java","lineNumber":407,"sourceCode":"      case INT64:\n        return Long.valueOf(fieldValue);\n      case INT16:\n      case INT32:\n        return Integer.valueOf(fieldValue);\n      case FLOAT:\n        return Float.parseFloat(fieldValue);\n      case DOUBLE:\n        return Double.parseDouble(fieldValue);\n      case BOOLEAN:\n        return Boolean.parseBoolean(fieldValue);\n      case BYTES:\n        return fieldValue.getBytes(StandardCharsets.UTF_8);\n      case DATETIME:\n        return new DateTime(fieldValue);\n      case DECIMAL:\n        return new BigDecimal(fieldValue);\n      default:\n        throw new IllegalArgumentException(\n            String.format(\"Unable to parse field with type %s\", fieldType));\n    }\n  }\n\n  private static Schema.FieldType spannerTypeToBeamType(Type spannerType) {\n    switch (spannerType.getCode()) {\n      case BOOL:\n        return Schema.FieldType.BOOLEAN;\n      case BYTES:\n        return Schema.FieldType.BYTES;\n      case STRING:\n        return Schema.FieldType.STRING;\n      case INT64:\n        return Schema.FieldType.INT64;\n      case NUMERIC:\n        return Schema.FieldType.DECIMAL;\n      case FLOAT64:\n        return Schema.FieldType.DOUBLE;","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/changestreams/SpannerChangestreamsReadSchemaTransformProvider.java#L389-L425","documentation":"Thrown by stringToParsedValue when a Spanner column value's Type has a code that the parser has no conversion branch for. Each known TypeCode (STRING, INT64, FLOAT64, BOOL, TIMESTAMP, DATE, BYTES, NUMERIC, JSON, DATETIME, DECIMAL...) is converted from its string fieldValue; anything outside the switch hits the default and raises IllegalArgumentException.","triggerScenarios":"A change stream record contains a column whose Spanner TypeCode is not among the handled cases (e.g. a newly added Spanner type, or PG-g dialect type codes) when mapping values into a Beam row.","commonSituations":"Using PostgreSQL-dialect Spanner databases whose type codes differ from GoogleSQL; Spanner introducing a new TypeCode not yet supported by the Beam connector version in use; schema changes adding exotic column types to a tracked table.","solutions":["Upgrade the Beam Google Cloud Platform connector to a version whose stringToParsedValue handles your column's type code.","Identify the offending type from the message and change the column type in Spanner to a supported one (e.g. NUMERIC vs DECIMAL dialect differences).","If on a PG-dialect database, check known dialect limitations of the Spanner change stream connector and convert types accordingly.","As a last resort, exclude the unsupported column from the queried columns so it never reaches the parser."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"STRING\",\"INT64\",\"FLOAT64\",\"BOOL\",\"TIMESTAMP\",\"DATE\",\"BYTES\",\"NUMERIC\",\"JSON\",\"DATETIME\",\"DECIMAL\");\nif (!supported.contains(fieldType.getCode().name())) { /* skip or transform column */ }","typeGuard":null,"tryCatchPattern":"try { row = stringToParsedValue(fieldValue, fieldType); } catch (IllegalArgumentException e) { log.warn(\"Unsupported type {}\", fieldType, e); return null; }","preventionTips":["Keep the Beam GCP connector up to date with Spanner type additions.","Audit tracked tables for PostgreSQL-dialect or newly introduced column types.","Prefer stable GoogleSQL types (STRING/INT64/NUMERIC) in change-streamed tables."],"tags":["spanner","type-parsing","unsupported-type","java"],"backgroundTag":"unsupported-enum-value","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"}