{"record":{"id":"3163619c2543b3b2","repo":"apache/shardingsphere","slug":"not-support-unpack-the-type-s","errorCode":null,"errorMessage":"not support unpack the type %s","messagePattern":"not support unpack the type (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"kernel/data-pipeline/scenario/cdc/client/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/client/util/ProtobufAnyValueConverter.java","lineNumber":94,"sourceCode":"        }\n        if (any.is(DoubleValue.class)) {\n            return any.unpack(DoubleValue.class).getValue();\n        }\n        if (any.is(BoolValue.class)) {\n            return any.unpack(BoolValue.class).getValue();\n        }\n        if (any.is(BytesValue.class)) {\n            return any.unpack(BytesValue.class).getValue().toByteArray();\n        }\n        if (any.is(com.google.protobuf.Timestamp.class)) {\n            return converProtobufTimestamp(any.unpack(com.google.protobuf.Timestamp.class));\n        }\n        if (any.is(Struct.class)) {\n            return JsonFormat.printer().print(any.unpack(Struct.class));\n        }\n        // TODO can't use JsonFormat, might change the original value without error prompt. there need to cover more types,\n        log.error(\"not support unpack value={}\", any);\n        throw new UnsupportedOperationException(String.format(\"not support unpack the type %s\", any.getTypeUrl()));\n    }\n    \n    private static Timestamp converProtobufTimestamp(final com.google.protobuf.Timestamp timestamp) {\n        Timestamp result = new Timestamp(timestamp.getSeconds() * 1000L);\n        result.setNanos(timestamp.getNanos());\n        return result;\n    }\n}\n","sourceCodeStart":76,"sourceCodeEnd":103,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/data-pipeline/scenario/cdc/client/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/client/util/ProtobufAnyValueConverter.java#L76-L103","documentation":"The CDC client converts google.protobuf.Any values from the server into Java objects. After checking all supported wrappers (int32, string, bytes, Timestamp, Struct, ...), an unrecognized type URL logs the value and throws UnsupportedOperationException with the type URL, because the client has no faithful conversion for that column type.","triggerScenarios":"A CDC-subscribed table contains a column whose protobuf Any wrapper type is outside the converter's supported set, and a row event for that table is delivered to the client; any.unpack is then impossible and the converter throws.","commonSituations":"Newer ShardingSphere server sending a newer Any wrapper type than the client jar understands (client/server version skew); exotic column types (e.g. specific numeric or temporal wrappers) not yet covered by ProtobufAnyValueConverter; the TODO in the source notes coverage is incomplete.","solutions":["Align CDC client jar version with the ShardingSphere proxy/server version so both sides support the same Any wrapper set.","Identify the column and type URL from the log line ('not support unpack value=...') and exclude or alter that column in the CDC subscription if it is not needed.","If the type is required, extend ProtobufAnyValueConverter locally to unpack that wrapper and rebuild the client.","Report the missing type upstream so the converter gains coverage."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"private static final Set<String> SUPPORTED_ANY_TYPES = Set.of(\n    \"type.googleapis.com/google.protobuf.Int32Value\",\n    \"type.googleapis.com/google.protobuf.StringValue\",\n    \"type.googleapis.com/google.protobuf.BytesValue\",\n    \"type.googleapis.com/google.protobuf.Timestamp\",\n    \"type.googleapis.com/google.protobuf.Struct\");\n\nstatic boolean isSupported(Any any) { return SUPPORTED_ANY_TYPES.contains(any.getTypeUrl()); }","tryCatchPattern":"try {\n    Object v = ProtobufAnyValueConverter.convert(any);\n} catch (final UnsupportedOperationException ex) {\n    log.warn(\"Unsupported Any type {}, skipping column\", any.getTypeUrl());\n}","preventionTips":["Keep CDC client and proxy on the same ShardingSphere version.","Subscribe only to columns with types you have verified convert correctly.","Log unsupported type URLs and add coverage incrementally."],"tags":["cdc","protobuf","client","type-conversion"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}