apache/beam · error · UnsupportedOperationException

proto type is unsupported.

Error message

proto type %s is unsupported.

What it means

When converting a BigQuery TableFieldSchema back into a protobuf DescriptorProto, any protobuf field type that has no mapped BigQuery primitive type is rejected with an UnsupportedOperationException. It indicates the proto descriptor contains a type outside the supported primitive set (e.g. internal groups or message types handled elsewhere).

Solutions

  1. Remove or flatten unsupported proto field types (groups, unsupported message fields) from the schema.
  2. Ensure only fields backed by PRIMITIVE_TYPES_PROTO_TO_BQ entries reach this conversion.
  3. Handle RECORD/message fields explicitly before the primitive branch so they don't fall through to default.
  4. Upgrade the Beam version — newer releases map more types.

Example fix

// before
proto descriptor contains field of type GROUP reaching default branch
// after
if (fieldDescriptor.getType() == Type.GROUP) { recurse as nested record instead of treating as primitive }
Defensive patterns

Strategy: type-guard

Validate before calling

boolean allSupported(Descriptor d) { return d.getFields().stream().allMatch(f -> f.isRepeated() || f.getType() != Type.GROUP && PRIMITIVE_TYPES.contains(f.getType()) || f.getMessageType() != null); }

Type guard

boolean isMappedPrimitive(FieldDescriptor fd) { return PRIMITIVE_TYPES_PROTO_TO_BQ.containsKey(fd.getType()); }

Try / catch

try { toTableSchema(descriptor); } catch (UnsupportedOperationException e) { LOG.error("Unmapped proto type: {}", e.getMessage()); }

Prevention

When it happens

Trigger: fieldDescriptorFromTableField-based schema translation (proto -> BigQuery TableFieldSchema, used for CDC / schema propagation) encounters a FieldDescriptor type not present in PRIMITIVE_TYPES_PROTO_TO_BQ — e.g. GROUP type or unexpected message types falling into the default branch.

Common situations: Using custom/extended proto schemas with the Storage Write API; Beam internal schemas with group fields; version mismatches where a new proto type isn't mapped yet.

Related errors


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

Appendix: source

Thrown at sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/TableRowToStorageApiProto.java:1255

        tableFieldSchemaBuilder.setName(fieldNameFromProtoFieldDescriptor(fieldDescriptor));

    switch (fieldDescriptor.getType()) {
      case MESSAGE:
        if (fieldDescriptor.getMessageType().getName().equals("TimestampPicos")) {
          tableFieldSchemaBuilder.setType(TableFieldSchema.Type.TIMESTAMP);
          tableFieldSchemaBuilder.setPrecision(PICOSECOND_PRECISION);
        } else {
          tableFieldSchemaBuilder = tableFieldSchemaBuilder.setType(TableFieldSchema.Type.STRUCT);
          TableSchema nestedTableField =
              tableSchemaFromDescriptor(fieldDescriptor.getMessageType());
          tableFieldSchemaBuilder =
              tableFieldSchemaBuilder.addAllFields(nestedTableField.getFieldsList());
        }
        break;
      default:
        TableFieldSchema.Type type = PRIMITIVE_TYPES_PROTO_TO_BQ.get(fieldDescriptor.getType());
        if (type == null) {
          throw new UnsupportedOperationException(
              "proto type " + fieldDescriptor.getType() + " is unsupported.");
        }
        tableFieldSchemaBuilder = tableFieldSchemaBuilder.setType(type);
    }

    if (fieldDescriptor.isRepeated()) {
      tableFieldSchemaBuilder = tableFieldSchemaBuilder.setMode(TableFieldSchema.Mode.REPEATED);
    } else if (fieldDescriptor.isRequired()) {
      tableFieldSchemaBuilder = tableFieldSchemaBuilder.setMode(TableFieldSchema.Mode.REQUIRED);
    } else {
      tableFieldSchemaBuilder = tableFieldSchemaBuilder.setMode(TableFieldSchema.Mode.NULLABLE);
    }
    return tableFieldSchemaBuilder.build();
  }

  @VisibleForTesting
  static DescriptorProto descriptorSchemaFromTableSchema(
      com.google.api.services.bigquery.model.TableSchema tableSchema,

View on GitHub (pinned to 12126d8942)