apache/beam · error · IllegalArgumentException

Unsupported Firestore value type: {valueTypeCase}

Error message

Unsupported Firestore value type: {valueTypeCase}

What it means

valueToJava converts a Firestore protocol Value proto into a Java object when reading documents into Rows. It throws IllegalArgumentException when the Value's oneof case (ValueTypeCase) is not one of the handled types — including VALUETYPE_NOT_SET being handled, so this fires for genuinely unknown/unhandled proto cases, typically from a newer Firestore proto feature this Beam version doesn't know.

Source

Thrown at sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/firestore/FirestoreUtils.java:150

        return value.getBytesValue().toByteArray();
      case NULL_VALUE:
        return null;
      case ARRAY_VALUE:
        List<@Nullable Object> values = new ArrayList<>();
        for (Value element : value.getArrayValue().getValuesList()) {
          values.add(valueToJava(element));
        }
        return values;
      case MAP_VALUE:
        Map<String, Object> map = new HashMap<>();
        for (Map.Entry<String, Value> entry : value.getMapValue().getFieldsMap().entrySet()) {
          map.put(entry.getKey(), valueToJava(entry.getValue()));
        }
        return map;
      case VALUETYPE_NOT_SET:
        return null;
      default:
        throw new IllegalArgumentException(
            "Unsupported Firestore value type: " + value.getValueTypeCase());
    }
  }

  private static Value javaToValue(Object value, FieldType fieldType) {
    if (value == null) {
      return Value.newBuilder().setNullValue(com.google.protobuf.NullValue.NULL_VALUE).build();
    }
    switch (fieldType.getTypeName()) {
      case STRING:
        return Value.newBuilder().setStringValue(value.toString()).build();
      case INT64:
        return Value.newBuilder().setIntegerValue(((Number) value).longValue()).build();
      case DOUBLE:
        return Value.newBuilder().setDoubleValue(((Number) value).doubleValue()).build();
      case BOOLEAN:
        return Value.newBuilder().setBooleanValue((Boolean) value).build();
      case DATETIME:

View on GitHub (pinned to 12126d8942)

Solutions

  1. Upgrade org.apache.beam:beam-sdks-java-io-google-cloud-platform (and its google-cloud-firestore dependency) to the latest version
  2. Inspect the offending document in the Firestore console and identify the exotic field type
  3. Remove or normalize unsupported fields in the document, or read them via a raw Firestore client instead of the Beam connector
  4. Pin a Firestore client version compatible with your Beam version to avoid proto mismatches

Example fix

// before (pom.xml)
<dependency><groupId>org.apache.beam</groupId><artifactId>beam-sdks-java-io-google-cloud-platform</artifactId><version>2.40.0</version></dependency>
// after
<dependency><groupId>org.apache.beam</groupId><artifactId>beam-sdks-java-io-google-cloud-platform</artifactId><version>2.61.0</version></dependency>
Defensive patterns

Strategy: try-catch

Try / catch

try {
  Row row = FirestoreUtils.documentToRow(document, schema, documentIdField);
} catch (IllegalArgumentException e) {
  if (e.getMessage().startsWith("Unsupported Firestore value type")) {
    log.warn("Skipping document with unsupported value type: {}", document.getName());
  } else { throw e; }
}

Prevention

When it happens

Trigger: Reading a Firestore document containing a value type the converter has no case for — e.g. documents written with newer Firestore features (or server-injected value cases) while running an older Beam google-cloud-platform SDK; a corrupted or mis-decoded Value proto.

Common situations: Version mismatch: Firestore server or client library emits a value type the pinned Beam/proto version predates; documents containing unusual field types written by other clients; upgrading Firestore data model without upgrading the Beam connector.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/dc13c65b30d9e075. Report an issue: GitHub.