{"record":{"id":"11decff0d1b97953","repo":"apache/seatunnel","slug":"unsupported-type-clazz","errorCode":null,"errorMessage":"Unsupported type: ${clazz}","messagePattern":"Unsupported type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/SeaTunnelRow.java","lineNumber":393,"sourceCode":"                return rowSize;\n            default:\n                if (v.getClass().isArray() && v instanceof Object[]) {\n                    int sum = 0;\n                    for (Object o : (Object[]) v) {\n                        sum += getBytesForValue(o);\n                    }\n                    return sum;\n                }\n                if (v instanceof Map) {\n                    int mapSize = 0;\n                    for (Map.Entry<?, ?> entry : ((Map<?, ?>) v).entrySet()) {\n                        mapSize +=\n                                getBytesForValue(entry.getKey())\n                                        + getBytesForValue(entry.getValue());\n                    }\n                    return mapSize;\n                }\n                throw new UnsupportedOperationException(\"Unsupported type: \" + clazz);\n        }\n    }\n\n    /** Compares only the stain trace payload carried in row options. */\n    public boolean hasSameTracePayload(SeaTunnelRow that) {\n        if (that == null) {\n            return false;\n        }\n        return Arrays.equals(getTracePayload(), that.getTracePayload());\n    }\n\n    @Override\n    public boolean equals(Object o) {\n        if (this == o) {\n            return true;\n        }\n        if (!(o instanceof SeaTunnelRow)) {\n            return false;","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/SeaTunnelRow.java#L375-L411","documentation":"getBytesForValue has a second overload switch on the Java class of the field value (used when no explicit SeaTunnelDataType is supplied). The default branch throws UnsupportedOperationException when the field's runtime class has no size-accounting rule, meaning the row cannot estimate this value's serialized size.","triggerScenarios":"Calling getBytesSize() on a row whose field value is an unrecognized Java class (e.g. a custom POJO, BigDecimal variant, or exotic object not in the known class list) in the class-based branch of getBytesForValue.","commonSituations":"Putting application POJOs or third-party types into SeaTunnelRow fields; upstream data converted to non-standard Java types by a custom source; version drift where a new Java type maps into an old size estimator.","solutions":["Convert the field value to a standard SeaTunnel-supported Java type (String, byte[], Integer, etc.) before putting it in the row","Supply an explicit SeaTunnelDataType (ArrayType/MapType etc.) so the type-based branch is used instead of the class-based one","Upgrade SeaTunnel if the type is a standard type added in a newer release","Exclude unsupported fields from the row or compute their size externally"],"exampleFix":"// before\nrow.setField(1, myCustomPojo);\nint size = row.getBytesSize(); // throws: Unsupported type: com.app.MyPojo\n// after\nrow.setField(1, objectMapper.writeValueAsBytes(myCustomPojo)); // byte[] is supported","handlingStrategy":"validation","validationCode":"boolean allKnown = Arrays.stream(row.getFields())\n    .allMatch(f -> f == null || f instanceof String || f instanceof Boolean || f instanceof Number\n        || f instanceof byte[] || f instanceof Map || f instanceof Object[] || f instanceof SeaTunnelRow);","typeGuard":null,"tryCatchPattern":"try {\n    int size = row.getBytesSize();\n} catch (UnsupportedOperationException e) {\n    int size = estimateWithKnownTypesOnly(row);\n}","preventionTips":["Only put standard Java types in SeaTunnelRow fields","Convert POJOs to supported types (e.g. byte[] via serialization) before insertion","Supply explicit SeaTunnelDataType so the typed branch is used","Avoid custom third-party value types in rows routed through size estimation"],"tags":["serialization","type-mismatch","unsupported-type"],"backgroundTag":"type-mismatch","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}