{"record":{"id":"5dc0b718f6a85b35","repo":"apache/beam","slug":"writing-of-iterable-type-is-not-supported-by-the-default","errorCode":null,"errorMessage":"Writing of ITERABLE type is not supported by the default UserDataMapper","messagePattern":"Writing of ITERABLE type is not supported by the default UserDataMapper","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/singlestore/src/main/java/org/apache/beam/sdk/io/singlestore/SingleStoreDefaultUserDataMapper.java","lineNumber":85,"sourceCode":"      case DECIMAL:\n        return ((BigDecimal) value).toString();\n      case FLOAT:\n        return ((Float) value).toString();\n      case DOUBLE:\n        return ((Double) value).toString();\n      case STRING:\n        return (String) value;\n      case DATETIME:\n        return formatter.print((Instant) value);\n      case BOOLEAN:\n        return ((Boolean) value) ? \"1\" : \"0\";\n      case BYTES:\n        return new String((byte[]) value, StandardCharsets.UTF_8);\n      case ARRAY:\n        throw new UnsupportedOperationException(\n            \"Writing of ARRAY type is not supported by the default UserDataMapper\");\n      case ITERABLE:\n        throw new UnsupportedOperationException(\n            \"Writing of ITERABLE type is not supported by the default UserDataMapper\");\n      case MAP:\n        throw new UnsupportedOperationException(\n            \"Writing of MAP type is not supported by the default UserDataMapper\");\n      case ROW:\n        throw new UnsupportedOperationException(\n            \"Writing of nested ROW type is not supported by the default UserDataMapper\");\n      case LOGICAL_TYPE:\n        return convertLogicalTypeFieldToString(type, value);\n      default:\n        throw new UnsupportedOperationException(\n            String.format(\n                \"Writing of %s type is not supported by the default UserDataMapper\",\n                type.getTypeName().name()));\n    }\n  }\n\n  @Override","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/singlestore/src/main/java/org/apache/beam/sdk/io/singlestore/SingleStoreDefaultUserDataMapper.java#L67-L103","documentation":"convertFieldToString in the default SingleStoreUserDataMapper cannot stringify ITERABLE-typed schema fields; the ITERABLE switch case throws UnsupportedOperationException because the default mapper has no serialization strategy for repeated/iterable values.","triggerScenarios":"SingleStoreIO.write() on a PCollection whose Row schema contains an ITERABLE field (e.g. from repeated Beam schema fields or Avro arrays) while using the default UserDataMapper.","commonSituations":"Sources producing repeated fields (Avro arrays, protobuf repeated) piped directly into SingleStore sink.","solutions":["Explode ITERABLE fields into separate rows or columns before the write","Convert the iterable to a JSON/CSV string field in the schema","Supply a custom UserDataMapper via withUserDataMapper that handles ITERABLE"],"exampleFix":"// before\n// Row with Iterable<String> tags -> throws on write\n// after\n// schema field changed to FieldType.STRING holding String.join(\",\", tags)","handlingStrategy":"validation","validationCode":"boolean hasIterable = row.getSchema().getFields().stream().anyMatch(f -> f.getType().getTypeName() == Schema.TypeName.ITERABLE); if (hasIterable) { /* explode or stringify */ }","typeGuard":null,"tryCatchPattern":"try { rows.apply(SingleStoreIO.write()...); } catch (UnsupportedOperationException e) { if (e.getMessage().contains(\"ITERABLE type is not supported\")) { /* unnest fields */ } throw e; }","preventionTips":["Explode repeated fields before the sink","Keep destination schemas flat: scalars and strings only","Review Avro/protobuf-derived schemas for repeated fields before choosing SingleStoreIO.write()"],"tags":["java","beam","singlestore","write","unsupported-type"],"backgroundTag":"operation-not-supported","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"}