{"record":{"id":"8f3e39fda380eba6","repo":"apache/seatunnel","slug":"seatunneldatatype-cannot-be-null","errorCode":null,"errorMessage":"seaTunnelDataType cannot be null","messagePattern":"seaTunnelDataType cannot be null","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/arrow/reader/ArrowToSeatunnelRowReader.java","lineNumber":237,"sourceCode":"                } else if (fieldValue instanceof String) {\n                    return LocalDateTime.parse((String) fieldValue, DATETIME_FORMATTER);\n                } else if (fieldValue instanceof Text) {\n                    return LocalDateTime.parse(((Text) fieldValue).toString(), DATETIME_FORMATTER);\n                } else {\n                    return fieldValue;\n                }\n            default:\n                return fieldValue;\n        }\n    }\n\n    private Object convertArrowData(\n            int rowIndex,\n            Types.MinorType minorType,\n            FieldVector fieldVector,\n            SeaTunnelDataType<?> seaTunnelDataType) {\n        if (seaTunnelDataType == null) {\n            throw new IllegalArgumentException(\"seaTunnelDataType cannot be null\");\n        }\n\n        for (Converter converter : converters) {\n            if (converter.support(minorType)) {\n                SqlType sqlType = seaTunnelDataType.getSqlType();\n                switch (sqlType) {\n                    case MAP:\n                        return convertMap(\n                                rowIndex, converter, fieldVector, (MapType) seaTunnelDataType);\n                    case ARRAY:\n                        return convertArray(\n                                rowIndex, converter, fieldVector, (ArrayType) seaTunnelDataType);\n                    case ROW:\n                        return convertRow(\n                                rowIndex,\n                                converter,\n                                fieldVector,\n                                (SeaTunnelRowType) seaTunnelDataType);","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-common/src/main/java/org/apache/seatunnel/connectors/seatunnel/common/source/arrow/reader/ArrowToSeatunnelRowReader.java#L219-L255","documentation":"ArrowToSeatunnelRowReader.convertArrowData requires a non-null SeaTunnelDataType to decide which converter branch to use for an Arrow FieldVector; a null type throws IllegalArgumentException. It means the schema/type resolution produced a null entry for a column before value conversion.","triggerScenarios":"Calling convertArrowData (via fieldValue) with seaTunnelDataType == null — usually because the SeaTunnelRowType's field type lookup returned null: a column name mismatch between Arrow schema and the configured SeaTunnel schema, or an incompletely built row type.","commonSituations":"Configured schema columns don't match the Arrow/ClickHouse result columns (typo, case mismatch, column removed upstream); programmatically constructed SeaTunnelRowType with a null in the types array; connector version where schema inference skipped a type.","solutions":["Verify every column name in the configured SeaTunnelRowType matches the source schema exactly (same order, spelling, case) so its type array is fully populated.","Null-check the constructed SeaTunnelRowType before creating the reader; fail fast with a clear message instead of a null field type.","Regenerate the schema from the actual table (schema inference) rather than hand-writing it if columns changed.","If constructing programmatically, assert types.length == fieldNames.length and no null elements."],"exampleFix":"// before\nSeaTunnelRowType t = new SeaTunnelRowType(names, types); // types contains null\n// after\nObjects.requireNonNull(t.getFieldType(\"user_id\"), \"missing type for column user_id\");\nSeaTunnelRowType t = buildTypeFromSchema(tableSchema);","handlingStrategy":"validation","validationCode":"// validate the row type before constructing the reader\nfor (int i = 0; i < rowType.getTotalFields(); i++) {\n    Objects.requireNonNull(rowType.getFieldType(i),\n        \"null type for field \" + rowType.getFieldName(i));\n}","typeGuard":"boolean rowTypeComplete(SeaTunnelRowType t) {\n    return t != null && t.getFieldNames().length == t.getFieldTypes().length\n        && Arrays.stream(t.getFieldTypes()).allMatch(Objects::nonNull);\n}","tryCatchPattern":"try {\n    Object v = convertArrowData(rowIndex, minorType, fieldVector, dataType);\n} catch (IllegalArgumentException e) {\n    LOG.error(\"type resolution failed for column {}\", fieldVector.getName());\n    throw new SchemaMismatchException(fieldVector.getName(), e);\n}","preventionTips":["Match configured column names to the Arrow/source schema exactly (name, order, case).","Build SeaTunnelRowType from schema inference rather than hand-written lists when possible.","Assert no null entries in the types array immediately after constructing the row type."],"tags":["arrow","null-argument","schema","type-mapping"],"backgroundTag":"null-argument","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"}