{"record":{"id":"3f597256ecddc260","repo":"apache/seatunnel","slug":"commonerrorcodedeprecated-unsupported-data-type-3f5972","errorCode":"CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE","errorMessage":"Unexpected value: ${typeClass}","messagePattern":"Unexpected value: (.+?)","errorType":"error_code","errorClass":"JdbcConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/psql/PostgresJdbcRowConverter.java","lineNumber":183,"sourceCode":"                    fields[fieldIndex] = JdbcFieldTypeUtils.getBytes(rs, resultSetIndex);\n                    break;\n                case NULL:\n                    fields[fieldIndex] = null;\n                    break;\n                case ARRAY:\n                    Array jdbcArray = rs.getArray(resultSetIndex);\n                    if (jdbcArray == null) {\n                        fields[fieldIndex] = null;\n                        break;\n                    }\n\n                    Object arrayObject = jdbcArray.getArray();\n                    if (((ArrayType) seaTunnelDataType)\n                            .getTypeClass()\n                            .equals(arrayObject.getClass())) {\n                        fields[fieldIndex] = arrayObject;\n                    } else {\n                        throw new JdbcConnectorException(\n                                CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,\n                                \"Unexpected value: \" + seaTunnelDataType.getTypeClass());\n                    }\n                    break;\n                case MAP:\n                case ROW:\n                default:\n                    throw new JdbcConnectorException(\n                            CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE,\n                            \"Unexpected value: \" + seaTunnelDataType);\n            }\n        }\n        return new SeaTunnelRow(fields);\n    }\n\n    @Override\n    public PreparedStatement toExternal(\n            TableSchema tableSchema,","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/psql/PostgresJdbcRowConverter.java#L165-L201","documentation":"In PostgresJdbcRowConverter.toInternal, when converting a JDBC array value to a SeaTunnel row, the Java class of the retrieved array object must exactly match the ArrayType's declared type class. Any mismatch (e.g. expected int[] but got Integer[] or Object[]) throws UNSUPPORTED_DATA_TYPE with the unexpected type class.","triggerScenarios":"Reading a Postgres ARRAY column where jdbcArray.getArray() returns a class different from ((ArrayType) seaTunnelDataType).getTypeClass() - typically a primitive-array vs boxed-array or multidimensional array mismatch.","commonSituations":"Postgres int4[]/int8[]/text[] columns whose driver returns boxed arrays; multidimensional arrays; schema declared with a different element type than the actual column.","solutions":["Align the SeaTunnel schema's array element type with the actual Postgres column type (e.g. array<int> for int4[])","Add a conversion for the returned array class, or normalize the array (e.g. convert Integer[] to int[]) before this branch","Avoid multidimensional Postgres arrays; flatten them or use supported types"],"exampleFix":"// before\n// schema: array<string> but column is varchar[][]\n// after\n// change column to text[] or map to array<string>","handlingStrategy":"validation","validationCode":"Object arr = jdbcArray.getArray();\nif (!((ArrayType) dataType).getTypeClass().equals(arr.getClass())) {\n    arr = normalizeArray(arr, ((ArrayType) dataType).getTypeClass());\n}","typeGuard":null,"tryCatchPattern":"try { row = converter.toInternal(rs); } catch (JdbcConnectorException e) { log.error(\"array column type mismatch: {}\", e.getMessage()); }","preventionTips":["Match SeaTunnel array element types exactly to Postgres column types","Avoid multidimensional arrays","Check boxed vs primitive array classes (Integer[] vs int[]) when debugging"],"tags":["jdbc","postgres","row-converter","array-type","unsupported-dtype"],"backgroundTag":"unsupported-dtype","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}