{"record":{"id":"61e57acb54683a66","repo":"apache/seatunnel","slug":"unsupported-type-sqltype","errorCode":null,"errorMessage":"Unsupported type: ${sqlType}","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":236,"sourceCode":"                int size = 0;\n                MapType<?, ?> mapType = ((MapType<?, ?>) dataType);\n                for (Map.Entry<?, ?> entry : ((Map<?, ?>) v).entrySet()) {\n                    size +=\n                            getBytesForValue(entry.getKey(), mapType.getKeyType())\n                                    + getBytesForValue(entry.getValue(), mapType.getValueType());\n                }\n                return size;\n            case ROW:\n                int rowSize = 0;\n                SeaTunnelRowType rowType = ((SeaTunnelRowType) dataType);\n                SeaTunnelDataType<?>[] types = rowType.getFieldTypes();\n                SeaTunnelRow row = (SeaTunnelRow) v;\n                for (int i = 0; i < types.length; i++) {\n                    rowSize += getBytesForValue(row.fields[i], types[i]);\n                }\n                return rowSize;\n            default:\n                throw new UnsupportedOperationException(\"Unsupported type: \" + sqlType);\n        }\n    }\n\n    private int getBytesForArray(Object v, SeaTunnelDataType<?> dataType) {\n        switch (dataType.getSqlType()) {\n            case STRING:\n                int s = 0;\n                for (String i : ((String[]) v)) {\n                    s += i == null ? 0 : i.length();\n                }\n                return s;\n            case BOOLEAN:\n                return getArrayNotNullSize((Boolean[]) v);\n            case TINYINT:\n                return getArrayNotNullSize((Byte[]) v);\n            case SMALLINT:\n                return getArrayNotNullSize((Short[]) v) * 2;\n            case INT:","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/SeaTunnelRow.java#L218-L254","documentation":"getBytesForValue (called via getBytesSize) computes a field's byte size with a switch over the field's SqlType; the default branch throws UnsupportedOperationException for SqlTypes with no defined size accounting. It indicates a type whose serialized size the row implementation does not know how to estimate.","triggerScenarios":"Computing row size for a row containing a field whose SqlType is not covered by the switch (e.g. certain nested or newer types like ARRAY/MAP variants in the outer switch) via getBytesSize() or getBytes().","commonSituations":"Newer SeaTunnel data types (e.g. newly added SqlTypes) used with an older row implementation; user-defined complex schemas streamed through size-accounting paths (checkpoint stats, serializers).","solutions":["Check which SqlType is unhandled and upgrade SeaTunnel to a version whose getBytesForValue covers it","Avoid routing rows with that SqlType through getBytesSize/getBytes (use your own estimator)","Flatten or convert the unsupported column type to a supported one in the schema","If you maintain a fork, add the missing case to the switch"],"exampleFix":"// before\nlong bytes = row.getBytesSize(); // UnsupportedOperationException for new SqlType\n// after\nlong bytes = isSizeAccountingSupported(rowType) ? row.getBytesSize() : fallbackSizeEstimate(row);","handlingStrategy":"try-catch","validationCode":"SqlType t = dataType.getSqlType();\nboolean covered = switch (t) { case STRING, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, DECIMAL, TIME, TIMESTAMP, TIMESTAMP_TZ, DATE, BYTES, ROW, ARRAY, MAP -> true; default -> false; };","typeGuard":null,"tryCatchPattern":"try {\n    long size = row.getBytesSize();\n} catch (UnsupportedOperationException e) {\n    long size = fallbackSize(row); // own estimator for uncovered SqlTypes\n}","preventionTips":["Check your schema for SqlTypes outside the covered set before using size accounting","Upgrade SeaTunnel when using newly added SqlTypes","Keep schemas to well-supported types in hot accounting paths","Cache sizes instead of recomputing when types are fixed"],"tags":["serialization","sql-type","unsupported-type"],"backgroundTag":"unsupported-operation","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"}