{"record":{"id":"ca4fcfd98afe2ea2","repo":"apache/beam","slug":"google-protobuf-any-is-not-supported","errorCode":null,"errorMessage":"google.protobuf.Any is not supported","messagePattern":"google\\.protobuf\\.Any is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/protobuf/src/main/java/org/apache/beam/sdk/extensions/protobuf/ProtoBeamConverter.java","lineNumber":259,"sourceCode":"                fieldDescriptor, bytes -> ByteString.copyFrom((byte[]) bytes));\n          case \"google.protobuf.Timestamp\":\n            return beam -> {\n              Instant instant = (Instant) beam;\n              return Timestamp.newBuilder()\n                  .setSeconds(instant.getEpochSecond())\n                  .setNanos(instant.getNano())\n                  .build();\n            };\n          case \"google.protobuf.Duration\":\n            return beam -> {\n              Duration duration = (Duration) beam;\n              return com.google.protobuf.Duration.newBuilder()\n                  .setSeconds(duration.getSeconds())\n                  .setNanos(duration.getNano())\n                  .build();\n            };\n          case \"google.protobuf.Any\":\n            throw new UnsupportedOperationException(\"google.protobuf.Any is not supported\");\n          default:\n            SerializableFunction<Row, Message> converter =\n                toProto(fieldDescriptor.getMessageType());\n            return value -> converter.apply((Row) value);\n        }\n      default:\n        throw new UnsupportedOperationException(\n            \"Unsupported proto type: \" + fieldDescriptor.getJavaType());\n    }\n  }\n\n  /** Gets a converter from non-null Proto value to non-null Beam. */\n  static <ProtoUnwrappedT, BeamT>\n      ProtoToBeamConverter<Object, BeamT> createWrappableProtoToBeamConverter(\n          ProtoToBeamConverter<ProtoUnwrappedT, BeamT> converter) {\n    return protoValue -> {\n      @NonNull ProtoUnwrappedT unwrappedProtoValue;\n      if (protoValue instanceof Message) {","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/protobuf/src/main/java/org/apache/beam/sdk/extensions/protobuf/ProtoBeamConverter.java#L241-L277","documentation":"Beam's ProtoBeamConverter translates protobuf messages to/from Beam Rows. The google.protobuf.Any well-known type has no Beam Row representation implemented, so when converting a schema-bearing message whose field type resolves to Any, the converter throws UnsupportedOperationException at converter-construction time.","triggerScenarios":"Building a Beam-to-proto converter (toProto/createBeamToProtoConverter, or map keys/values) for a message type that contains a field of type google.protobuf.Any.","commonSituations":"Protobuf schemas that use Any for polymorphic payloads (common in gRPC-adjacent message definitions) being ingested or emitted via Beam's schema API; teams migrating a proto with Any fields into a Beam pipeline.","solutions":["Remove the google.protobuf.Any field from the message, or wrap it in a message type the converter supports","Replace Any with a concrete message type or a oneof of supported types","Convert the Any field to a primitive (e.g. bytes type_url+value) in an intermediate message before Beam conversion","Pre-convert the message yourself (toJSON/base64 the Any) and carry it as a STRING/BYTES Beam field"],"exampleFix":"// before\nmessage Wrapper { google.protobuf.Any payload = 1; }\n// after\nmessage Wrapper { SpecificPayload payload = 1; } // or oneof of concrete types","handlingStrategy":"validation","validationCode":"boolean usesAny(Descriptors.Descriptor d) { for (Descriptors.FieldDescriptor f : d.getFields()) { if (\"google.protobuf.Any\".equals(f.getMessageType() != null ? f.getMessageType().getFullName() : \"\")) return true; } return false; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Lint proto schemas for google.protobuf.Any before enabling Beam schema conversion","Replace Any with concrete message types or oneof in pipeline-facing protos","Test schema generation early with all messages the pipeline will convert"],"tags":["protobuf","beam","unsupported-type"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}