apache/beam · error · IllegalArgumentException

Unsupported cell value type

Error message

Unsupported cell value type '%s'.

What it means

CellValueParser.getCellValue throws IllegalArgumentException with "Unsupported cell value type '%s'." when the field's TypeName falls into the default branch of its switch — i.e. the declared Schema.FieldType is not one of the primitive types the parser knows how to decode from a Bigtable ByteString cell.

Solutions

  1. Declare the cell field as BYTES or STRING and do the conversion/collection assembly in your own DoFn.
  2. Check the FieldType you configured matches a supported primitive type for cell values.
  3. Flatten arrays/maps into separate cells or use a custom parse function instead of schema-based mapping.

Example fix

// before
Schema.FieldType type = Schema.FieldType.iterable(Schema.FieldType.INT64);
// after
Schema.FieldType type = Schema.FieldType.BYTES; // decode Iterable<Integer> yourself from the bytes
Defensive patterns

Strategy: validation

Validate before calling

java.util.Set<Schema.TypeName> supported = java.util.Set.of(
  Schema.TypeName.STRING, Schema.TypeName.BYTES, Schema.TypeName.INT64,
  Schema.TypeName.DOUBLE, Schema.TypeName.BOOLEAN);
for (Schema.Field f : schema.getFields()) {
  if (!supported.contains(f.getType().getTypeName())) {
    throw new IllegalArgumentException("Cell field " + f.getName() + " type "
      + f.getType().getTypeName() + " not supported for Bigtable cell parsing.");
  }
}

Type guard

static boolean isScalarFieldType(Schema.FieldType t) {
  return !java.util.EnumSet.of(Schema.TypeName.ARRAY, Schema.TypeName.ITERABLE,
    Schema.TypeName.MAP, Schema.TypeName.ROW).contains(t.getTypeName());
}

Prevention

When it happens

Trigger: Calling getCellValue (directly or via BigtableIO schema mapping) with a FieldType whose TypeName is not STRING/BYTES/INT/FLOAT/DOUBLE/BOOLEAN/DECIMAL/etc. handled by the switch, e.g. an ARRAY, MAP, ITERABLE, or ROW type for a single cell value.

Common situations: Mapping a Bigtable cell to a collection or nested-row schema field; autogenerated schemas where a field was declared as repeated; version upgrades that introduced new TypeNames not yet handled by this parser.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigtable/CellValueParser.java:72

        checkArgument(valueSize == 8, message("Int64", 8));
        return Longs.fromByteArray(cellValue.toByteArray());
      case FLOAT:
        checkArgument(valueSize == 4, message("Float", 4));
        return Float.intBitsToFloat(Ints.fromByteArray(cellValue.toByteArray()));
      case DOUBLE:
        checkArgument(valueSize == 8, message("Double", 8));
        return Double.longBitsToDouble(Longs.fromByteArray(cellValue.toByteArray()));
      case DATETIME:
        return DateTime.parse(cellValue.toStringUtf8());
      case STRING:
        return cellValue.toStringUtf8();
      case BYTES:
        return cellValue.toByteArray();
      case LOGICAL_TYPE:
        String identifier = checkArgumentNotNull(type.getLogicalType()).getIdentifier();
        throw new IllegalStateException("Unsupported logical type: " + identifier);
      default:
        throw new IllegalArgumentException(
            String.format("Unsupported cell value type '%s'.", type.getTypeName()));
    }
  }

  ByteString valueToByteString(Object value, Schema.FieldType type) {
    switch (type.getTypeName()) {
      case BOOLEAN:
        return byteString(((Boolean) value) ? new byte[] {1} : new byte[] {0});
      case FLOAT:
        return byteString(Ints.toByteArray(Float.floatToIntBits((Float) value)));
      case DOUBLE:
        return byteString(Longs.toByteArray(Double.doubleToLongBits((Double) value)));
      case BYTE:
        return byteString(new byte[] {(Byte) value});
      case INT16:
        return byteString(Shorts.toByteArray((Short) value));
      case INT32:
        return byteString(Ints.toByteArray((Integer) value));

View on GitHub (pinned to 12126d8942)