{"record":{"id":"8e9b78eb0dd144fa","repo":"apache/beam","slug":"unsupported-field-type-fieldtype","errorCode":null,"errorMessage":"Unsupported field type: {fieldType}","messagePattern":"Unsupported field type: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreUtils.java","lineNumber":227,"sourceCode":"        Schema rowSchema = fieldType.getRowSchema();\n        if (rowSchema == null) {\n          throw new IllegalArgumentException(\"Row schema cannot be null.\");\n        }\n        if (!(value instanceof Row)) {\n          throw new IllegalArgumentException(\"Expected Row for nested field.\");\n        }\n        MapValue.Builder nestedMapBuilder = MapValue.newBuilder();\n        Row nestedRow = (Row) value;\n        for (Field nestedField : rowSchema.getFields()) {\n          Object nestedValue = nestedRow.getValue(nestedField.getName());\n          if (nestedValue != null) {\n            nestedMapBuilder.putFields(\n                nestedField.getName(), javaToValue(nestedValue, nestedField.getType()));\n          }\n        }\n        return Value.newBuilder().setMapValue(nestedMapBuilder.build()).build();\n      default:\n        throw new IllegalArgumentException(\"Unsupported field type: \" + fieldType);\n    }\n  }\n\n  private static @Nullable Object convertFromJava(@Nullable Object value, FieldType fieldType) {\n    if (value == null) {\n      return null;\n    }\n    switch (fieldType.getTypeName()) {\n      case BYTE:\n        return ((Number) value).byteValue();\n      case INT16:\n        return ((Number) value).shortValue();\n      case INT32:\n        return ((Number) value).intValue();\n      case INT64:\n        return ((Number) value).longValue();\n      case FLOAT:\n        return ((Number) value).floatValue();","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreUtils.java#L209-L245","documentation":"javaToValue switches over the FieldType's TypeName; any type not explicitly handled (the default branch) is unsupported for Firestore serialization and triggers IllegalArgumentException('Unsupported field type: ...'). This acts as the exhaustive-check for the converter's supported type set.","triggerScenarios":"Writing a Row containing a field whose type has no Firestore mapping — e.g. BYTES variants not handled, DATETIME/logical types, or exotic custom logical types — through Firestore IO writes via rowToDocument.","commonSituations":"Schemas auto-generated from sources with types Firestore can't represent (e.g. Kafka Connect complex types); Beam logical-type fields; upgrading schemas to include new Beam TypeName values on an older connector.","solutions":["Check the FieldType before writing and convert unsupported fields to supported ones (string, numeric, boolean, bytes, array, map, row, timestamp)","Use FieldType.withLogicalType only if the underlying storage type is supported","Drop or project out unsupported columns upstream with a Select/Map transform","Upgrade the Beam connector, which may cover more types"],"exampleFix":"// before\nSchema schema = Schema.builder().addField(\"custom\", FieldType.logicalType(myLogic)).build(); // unsupported\n// after\nSchema schema = Schema.builder().addStringField(\"custom\").build(); // serialize to string first","handlingStrategy":"validation","validationCode":"for (Field f : schema.getFields()) {\n  switch (f.getType().getTypeName()) {\n    case STRING: case INT64: case DOUBLE: case BOOLEAN: case BYTES:\n    case ARRAY: case ITERABLE: case MAP: case ROW: case DATETIME: break;\n    default: throw new IllegalStateException(\"Unsupported for Firestore: \" + f.getType());\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Project out unsupported columns before Firestore writes","Restrict schemas to the documented supported type set","Upgrade the connector when new Beam types appear"],"tags":["java","apache-beam","firestore","unsupported-type"],"backgroundTag":"unsupported-operation","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"}