{"record":{"id":"73d393578a1bf7ca","repo":"apache/seatunnel","slug":"unsupported-type-in-localtimearraytype-elesqlty","errorCode":null,"errorMessage":"Unsupported type in LocalTimeArrayType: ${eleSqlType}","messagePattern":"Unsupported type in LocalTimeArrayType: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/SeaTunnelRow.java","lineNumber":211,"sourceCode":"            case SPARSE_FLOAT_VECTOR:\n                return ((Map<?, ?>) v).entrySet().size() * 8;\n            case ARRAY:\n                SeaTunnelDataType elementType = ((ArrayType) dataType).getElementType();\n                if (elementType instanceof DecimalType) {\n                    return ((Object[]) v).length * 36;\n                }\n                if (elementType instanceof LocalTimeType) {\n                    SqlType eleSqlType = elementType.getSqlType();\n                    switch (eleSqlType) {\n                        case DATE:\n                            return ((Object[]) v).length * 24;\n                        case TIME:\n                            return ((Object[]) v).length * 12;\n                        case TIMESTAMP:\n                        case TIMESTAMP_TZ:\n                            return ((Object[]) v).length * 48;\n                        default:\n                            throw new UnsupportedOperationException(\n                                    \"Unsupported type in LocalTimeArrayType: \" + eleSqlType);\n                    }\n                }\n\n                return getBytesForArray(v, ((ArrayType) dataType).getElementType());\n            case MAP:\n                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();","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/type/SeaTunnelRow.java#L193-L229","documentation":"When computing the serialized byte size of a SeaTunnelRow, array-typed fields with LocalTime element types are sized per-element, but only a subset of SQL types (like TIME/TIMESTAMP) have known fixed sizes. An unexpected element SqlType inside an array at that branch causes UnsupportedOperationException naming the element type.","triggerScenarios":"Calling getBytesSize()/getBytes() on a row containing an ArrayType field whose element type falls into the unsupported branch of the LocalTime-array sizing switch (an element SqlType not handled there).","commonSituations":"Rows with exotic array element types (e.g. arrays of NULL, ROW, or time variants) passed through size accounting, typically in serializers or metrics that compute record size.","solutions":["Inspect the array's element SqlType and avoid unsupported element types in LocalTime array fields","Upgrade SeaTunnel — newer versions extend byte-size accounting to more types","Compute sizes yourself for that field instead of relying on getBytesSize","Convert the field to a supported array type (e.g. STRING) before size computation"],"exampleFix":"// before\nint size = row.getBytesSize(); // throws for unsupported array element type\n// after\nint size = supportsByteSizing(fieldType) ? row.getBytesSize() : estimateSizeManually(row);","handlingStrategy":"try-catch","validationCode":"SqlType ele = ((ArrayType) fieldType).getElementType().getSqlType();\nboolean safe = ele == SqlType.TIME || ele == SqlType.TIMESTAMP || ele == SqlType.TIMESTAMP_TZ;","typeGuard":null,"tryCatchPattern":"try {\n    int size = row.getBytesSize();\n} catch (UnsupportedOperationException e) {\n    int size = manualSizeEstimate(row); // custom accounting for exotic arrays\n}","preventionTips":["Restrict LocalTime arrays to TIME/TIMESTAMP element types","Keep SeaTunnel updated so new array element types are covered","Wrap size-accounting calls for rows with complex nested types","Prefer explicit data types so getBytesForArray handles the branch"],"tags":["serialization","array","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"}