{"record":{"id":"efe67f61dd8953ed","repo":"apache/seatunnel","slug":"cannot-convert-field-s-from-type-s-to-s-of-paim","errorCode":null,"errorMessage":"Cannot convert field %s from type %s to %s of Paimon table %s.","messagePattern":"Cannot convert field (.+?) from type (.+?) to (.+?) of Paimon table (.+?)\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink/schema/handler/AlterPaimonTableSchemaEventHandler.java","lineNumber":183,"sourceCode":"        DataField dataField = sinkPaimonTableSchema.fields().get(idx);\n        DataType oldDataType = dataField.type();\n        switch (canConvert(oldDataType, newDataType)) {\n            case CONVERT:\n                paimonCatalog.alterTable(\n                        identifier,\n                        SchemaChange.updateColumnType(oldColumnName, newDataType),\n                        false);\n                break;\n            case IGNORE:\n                log.warn(\n                        \"old: {{}-{}} and new: {{}-{}} belongs to the same type family, but old type has higher precision than new type. Ignore this convert request.\",\n                        dataField.name(),\n                        oldDataType,\n                        reconvertColumn.getName(),\n                        newDataType);\n                break;\n            case EXCEPTION:\n                throw new UnsupportedOperationException(\n                        String.format(\n                                \"Cannot convert field %s from type %s to %s of Paimon table %s.\",\n                                oldColumnName, oldDataType, newDataType, identifier.getFullName()));\n        }\n        if (StringUtils.isNotBlank(afterTheColumn)) {\n            paimonCatalog.alterTable(\n                    identifier,\n                    SchemaChange.updateColumnPosition(\n                            SchemaChange.Move.after(oldColumnName, afterTheColumn)),\n                    false);\n        }\n        String comment = newColumn.getComment();\n        if (StringUtils.isNotBlank(comment)) {\n            paimonCatalog.alterTable(\n                    identifier, SchemaChange.updateColumnComment(oldColumnName, comment), false);\n        }\n        paimonCatalog.alterTable(\n                identifier,","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink/schema/handler/AlterPaimonTableSchemaEventHandler.java#L165-L201","documentation":"When a column type-change event cannot be converted (converter resolution EXCEPTION mode), updateColumn throws UnsupportedOperationException stating the field, old type, new type and Paimon table. Paimon requires explicit compatible type conversion rules; an impossible or unsafe conversion is refused rather than silently corrupting the table.","triggerScenarios":"An AlterColumnTypeEvent is applied to a Paimon table where the old SeaTunnel data type cannot be reconverted/mapped to the requested new Paimon type — typeConvertResolver returns EXCEPTION, e.g. INT -> ARRAY, STRING -> INT with data present, or unmapped custom types.","commonSituations":"Upstream schema changed a column to an incompatible type; automatic type inference picked a narrower type; connector version mapping tables differ between old/new data types for the same logical column.","solutions":["Check whether the old-to-new type conversion is valid for Paimon (e.g. widen only: INT->BIGINT, FLOAT->DOUBLE)","Perform the type change manually in Paimon (ALTER TABLE ... ALTER COLUMN ... TYPE) or recreate the table/rewrite data","Configure the type conversion mode (e.g. EXCEPTION -> a permissive/legacy mode) if your deployment allows lossy conversion","Align upstream schema-change events so column types only change compatibly"],"exampleFix":"// before\n-- event: ALTER COLUMN age STRING (from INT)\n// after\n-- use compatible widening instead\nALTER TABLE t ALTER COLUMN age BIGINT;","handlingStrategy":"validation","validationCode":"boolean isCompatibleTypeChange(DataType old, DataType desired) { Set<String> allowed = Set.of(\"INT->BIGINT\",\"FLOAT->DOUBLE\",\"STRING->STRING\",\"TINYINT->INT\"); return old.equals(desired) || allowed.contains(old + \"->\" + desired); }","typeGuard":null,"tryCatchPattern":"try { handler.apply(columnTypeEvent); } catch (UnsupportedOperationException e) { log.error(\"Incompatible type conversion on {}: {}\", tablePath, e.getMessage()); /* fall back to manual migration */ }","preventionTips":["Restrict upstream schema changes to compatible (widening) type changes","Test type conversions in a staging Paimon table before production","Document the supported conversion matrix for your deployment"],"tags":["schema-evolution","paimon","type-conversion","type-mismatch"],"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"}