apache/beam · error · UnsupportedOperationException
Writing of ITERABLE type is not supported by the default Use
Error message
Writing of ITERABLE type is not supported by the default UserDataMapper
What it means
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.
Source
Thrown at sdks/java/io/singlestore/src/main/java/org/apache/beam/sdk/io/singlestore/SingleStoreDefaultUserDataMapper.java:85
case DECIMAL:
return ((BigDecimal) value).toString();
case FLOAT:
return ((Float) value).toString();
case DOUBLE:
return ((Double) value).toString();
case STRING:
return (String) value;
case DATETIME:
return formatter.print((Instant) value);
case BOOLEAN:
return ((Boolean) value) ? "1" : "0";
case BYTES:
return new String((byte[]) value, StandardCharsets.UTF_8);
case ARRAY:
throw new UnsupportedOperationException(
"Writing of ARRAY type is not supported by the default UserDataMapper");
case ITERABLE:
throw new UnsupportedOperationException(
"Writing of ITERABLE type is not supported by the default UserDataMapper");
case MAP:
throw new UnsupportedOperationException(
"Writing of MAP type is not supported by the default UserDataMapper");
case ROW:
throw new UnsupportedOperationException(
"Writing of nested ROW type is not supported by the default UserDataMapper");
case LOGICAL_TYPE:
return convertLogicalTypeFieldToString(type, value);
default:
throw new UnsupportedOperationException(
String.format(
"Writing of %s type is not supported by the default UserDataMapper",
type.getTypeName().name()));
}
}
@OverrideView on GitHub (pinned to 12126d8942)
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
Example fix
// before
// Row with Iterable<String> tags -> throws on write
// after
// schema field changed to FieldType.STRING holding String.join(",", tags) Defensive patterns
Strategy: validation
Validate before calling
boolean hasIterable = row.getSchema().getFields().stream().anyMatch(f -> f.getType().getTypeName() == Schema.TypeName.ITERABLE); if (hasIterable) { /* explode or stringify */ } Try / catch
try { rows.apply(SingleStoreIO.write()...); } catch (UnsupportedOperationException e) { if (e.getMessage().contains("ITERABLE type is not supported")) { /* unnest fields */ } throw e; } Prevention
- 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()
When it happens
Trigger: 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.
Common situations: Sources producing repeated fields (Avro arrays, protobuf repeated) piped directly into SingleStore sink.
Related errors
- Writing of ARRAY type is not supported by the default UserDa
- Converting %s to Beam schema type is not supported
- Writing of MAP type is not supported by the default UserData
- Could not decode the value from Row
- Unsupported integer bit width: ${type.getBitWidth()}
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/5dc0b718f6a85b35.
Report an issue: GitHub.