{"record":{"id":"6a33a50bb3ec53a4","repo":"apache/beam","slug":"pub-sub-schema-type-s-is-not-supported-at-this-time","errorCode":null,"errorMessage":"Pub/Sub schema type %s is not supported at this time","messagePattern":"Pub/Sub schema type (.+?) is not supported at this time","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubClient.java","lineNumber":568,"sourceCode":"\n  /** Create {@link com.google.api.services.pubsub.model.Schema} from Schema definition content. */\n  public abstract void createSchema(\n      SchemaPath schemaPath, String schemaContent, com.google.pubsub.v1.Schema.Type type)\n      throws IOException;\n\n  /** Delete {@link SchemaPath}. */\n  public abstract void deleteSchema(SchemaPath schemaPath) throws IOException;\n\n  /** Return {@link SchemaPath} from {@link TopicPath} if exists. */\n  public abstract @Nullable SchemaPath getSchemaPath(TopicPath topicPath) throws IOException;\n\n  /** Return a Beam {@link Schema} from the Pub/Sub schema resource, if exists. */\n  public abstract Schema getSchema(SchemaPath schemaPath) throws IOException;\n\n  /** Convert a {@link com.google.api.services.pubsub.model.Schema} to a Beam {@link Schema}. */\n  static Schema fromPubsubSchema(com.google.api.services.pubsub.model.Schema pubsubSchema) {\n    if (!schemaTypeToConversionFnMap.containsKey(pubsubSchema.getType())) {\n      throw new IllegalArgumentException(\n          String.format(\n              \"Pub/Sub schema type %s is not supported at this time\", pubsubSchema.getType()));\n    }\n    SerializableFunction<String, Schema> definitionToSchemaFn =\n        checkStateNotNull(schemaTypeToConversionFnMap.get(pubsubSchema.getType()));\n    String definition =\n        checkNotNull(pubsubSchema.getDefinition(), \"Pub/Sub schema definition is null\");\n    return definitionToSchemaFn.apply(definition);\n  }\n\n  /** Convert a {@link com.google.pubsub.v1.Schema} to a Beam {@link Schema}. */\n  static Schema fromPubsubSchema(com.google.pubsub.v1.Schema pubsubSchema) {\n    String typeName = pubsubSchema.getType().name();\n    if (!schemaTypeToConversionFnMap.containsKey(typeName)) {\n      throw new IllegalArgumentException(\n          String.format(\"Pub/Sub schema type %s is not supported at this time\", typeName));\n    }\n    SerializableFunction<String, Schema> definitionToSchemaFn =","sourceCodeStart":550,"sourceCodeEnd":586,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubClient.java#L550-L586","documentation":"PubsubClient.fromPubsubSchema converts a REST (com.google.api.services.pubsub.model) Schema into a Beam Schema. Only types present in schemaTypeToConversionFnMap (AVRO and PROTO) are supported; any other schema type cannot be converted, so an IllegalArgumentException naming the unsupported type is thrown.","triggerScenarios":"Reading from a Pub/Sub topic with a schema whose type is not in schemaTypeToConversionFnMap, e.g. a schema of type other than AVRO/PROTO, when PubsubIO resolves the topic schema (readWithSchema / schema-aware reads).","commonSituations":"Topic schema created with a newer/experimental Pub/Sub schema type; schema changed on the topic after the pipeline was written; using a protocol-buffer schema variant that the Beam version in use does not map.","solutions":["Change the topic's schema to AVRO (or a supported PROTO type)","Upgrade Beam to a version whose schemaTypeToConversionFnMap includes the schema type","Read without schema resolution (plain PubsubIO.read) and parse bytes manually","Delete/recreate the schema resource attached to the topic with a supported type"],"exampleFix":"// before\ngcloud pubsub schemas create my-schema --type=unsupported-type --definition=file.json\n// after\ngcloud pubsub schemas create my-schema --type=AVRO --definition=file.avsc","handlingStrategy":"try-catch","validationCode":"if (!\"AVRO\".equals(pubsubSchema.getType()) && !\"PROTOCOL_BUFFER\".equals(pubsubSchema.getType())) {\n  throw new IllegalArgumentException(\"Unsupported Pub/Sub schema type: \" + pubsubSchema.getType());\n}","typeGuard":null,"tryCatchPattern":"try { Schema s = PubsubClient.fromPubsubSchema(restSchema); } catch (IllegalArgumentException e) { /* use non-schema read path */ }","preventionTips":["Use AVRO schemas on topics read with schema-aware PubsubIO","Keep Beam up to date with supported schema types","Confirm schema type before wiring schema-aware reads","Avoid exotic/custom schema types on Beam-consumed topics"],"tags":["java","pubsub","schema","unsupported","avro"],"backgroundTag":"unsupported-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-15T02:17:10.978Z"}