{"record":{"id":"486ad68eb728dd25","repo":"apache/beam","slug":"unsupported-spanner-type-s","errorCode":null,"errorMessage":"Unsupported spanner type: %s","messagePattern":"Unsupported spanner 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":434,"sourceCode":"      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;\n      case TIMESTAMP:\n      case DATE:\n        return Schema.FieldType.DATETIME;\n      case ARRAY:\n        return Schema.FieldType.array(spannerTypeToBeamType(spannerType.getArrayElementType()));\n      case JSON:\n      case STRUCT:\n      default:\n        throw new IllegalArgumentException(\n            String.format(\"Unsupported spanner type: %s\", spannerType));\n    }\n  }\n}\n","sourceCodeStart":416,"sourceCodeEnd":439,"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#L416-L439","documentation":"Thrown by spannerTypeToBeamType when converting a Spanner Type to a Beam Schema.FieldType and the type code is JSON, STRUCT, or otherwise unrecognized. The connector has no Beam representation for these types in change stream schema mapping, so it raises IllegalArgumentException naming the Spanner type.","triggerScenarios":"The tracked table contains a JSON or STRUCT (protocol-buffer) typed column, or an array of such a type, so the schema translation recursion reaches an unhandled TypeCode.","commonSituations":"Tables using Spanner JSON columns or protobuf STRUCT columns included in a change stream; nested ARRAY<JSON>/ARRAY<STRUCT> columns; newer connector versions dropping support the user relied on.","solutions":["Move JSON/STRUCT data into a STRING column (or flatten STRUCT fields into scalar columns) in the tracked table.","Restrict the change stream / read to tables without JSON or STRUCT columns.","Upgrade the Beam connector in case a newer version added mappings for these type codes.","Post-process upstream: materialize the unsupported column as a supported type via a view before change-stream consumption."],"exampleFix":"// before (Spanner DDL)\nCREATE TABLE t (extra JSON);\n// after\nCREATE TABLE t (extra STRING(MAX)); -- store JSON as string","handlingStrategy":"validation","validationCode":"for (Type t : columnTypes) {\n  if (t.getCode() == TypeCode.JSON || t.getCode() == TypeCode.STRUCT)\n    throw new IllegalArgumentException(\"Unsupported column type in change stream: \" + t.getCode());\n}","typeGuard":null,"tryCatchPattern":"try { beamType = spannerTypeToBeamType(spannerType); } catch (IllegalArgumentException e) { return Schema.FieldType.STRING.withNullable(true); }","preventionTips":["Avoid JSON and STRUCT (protobuf) columns in tables consumed via change streams; use STRING instead.","Check table DDL before enabling a change stream on it.","Pin and update the connector version known to support your schema."],"tags":["spanner","unsupported-type","schema-mapping","java"],"backgroundTag":"unsupported-operation","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"}