{"record":{"id":"ae9441a4d73c670f","repo":"apache/seatunnel","slug":"unsupported-convert-value-getclass-to-row-ty","errorCode":null,"errorMessage":"Unsupported convert ${value.getClass()} to Row, typeDefine: ${typeDefine}","messagePattern":"Unsupported convert (.+?) to Row, typeDefine: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/converter/BasicDataConverter.java","lineNumber":236,"sourceCode":"                Object object = iterator.next();\n                SeaTunnelDataType<?> type = typeDefine.getFieldType(i);\n                array[i] = convert(type, object);\n            }\n            return new SeaTunnelRow(array);\n        }\n        if (value instanceof Map) {\n            Map map = (Map) value;\n\n            Object[] array = new Object[typeDefine.getTotalFields()];\n            for (int i = 0; i < typeDefine.getTotalFields(); i++) {\n                String key = typeDefine.getFieldName(i);\n                SeaTunnelDataType<?> type = typeDefine.getFieldType(i);\n                Object object = map.get(key);\n                array[i] = convert(type, object);\n            }\n            return new SeaTunnelRow(array);\n        }\n        throw new UnsupportedOperationException(\n                \"Unsupported convert \" + value.getClass() + \" to Row, typeDefine: \" + typeDefine);\n    }\n\n    default String convertString(T typeDefine, Object value) throws UnsupportedOperationException {\n        if (value instanceof String) {\n            return (String) value;\n        }\n        if (value instanceof Number) {\n            return convertString(typeDefine, (Number) value);\n        }\n        if (value instanceof byte[]) {\n            return convertString(typeDefine, (byte[]) value);\n        }\n        if (value instanceof Boolean) {\n            return convertString(typeDefine, (boolean) value);\n        }\n        if (value instanceof Date) {\n            return convertString(typeDefine, (Date) value);","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/converter/BasicDataConverter.java#L218-L254","documentation":"convertRow accepts only SeaTunnelRow, Collection, or Map values; any other class reaches the final throw of this UnsupportedOperationException. The message names the offending class and the expected row type. It means the value on the ROW conversion path has an entirely unsupported shape, not merely a wrong field count (that is the size check, error 83).","triggerScenarios":"Calling convertRow(...) or convert(...) with a ROW SqlType column while value is a String, POJO, byte[], or other object that is neither SeaTunnelRow, Collection, nor Map.","commonSituations":"A JSON string was never deserialized; a custom record/struct class from another framework was passed directly; the wrong converter method was chosen for the actual data shape.","solutions":["Deserialize or adapt the value into a java.util.Map keyed by field name, or a List ordered by the row type's fields, before calling convertRow.","Construct a SeaTunnelRow explicitly: new SeaTunnelRow(new Object[]{...}) and pass that.","Override convertRow in a converter subclass to handle your POJO type.","Verify the column SqlType is ROW; if the data is scalar, correct the schema or use the matching convert method (convertString, etc.)."],"exampleFix":"// before\nconverter.convertRow(rowType, column, jsonString);\n// after\nMap<String, Object> fields = new ObjectMapper().readValue(jsonString, new TypeReference<Map<String, Object>>() {});\nconverter.convertRow(rowType, column, fields);","handlingStrategy":"type-guard","validationCode":"if (!(value instanceof SeaTunnelRow) && !(value instanceof Collection) && !(value instanceof Map)) {\n    throw new IllegalArgumentException(\"convertRow needs SeaTunnelRow/Collection/Map, got \" + value.getClass());\n}","typeGuard":"boolean isRowConvertible(Object v) {\n    return v instanceof SeaTunnelRow || v instanceof Collection || v instanceof Map;\n}","tryCatchPattern":"try {\n    return converter.convertRow(rowType, column, value);\n} catch (UnsupportedOperationException e) {\n    LOG.warn(\"Row conversion unsupported for {}: {}\", value.getClass(), e.getMessage());\n    return null;\n}","preventionTips":["Deserialize JSON/struct strings into Map before row conversion.","Build SeaTunnelRow explicitly for POJO data.","Route scalar values to the specific convert method matching their SqlType, not convertRow.","Add type checks at the connector boundary."],"tags":["type-mismatch","row-conversion","seatunnel-api"],"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"}