{"record":{"id":"9e49722cae120771","repo":"apache/seatunnel","slug":"data-deserialize-failed","errorCode":"DATA_DESERIALIZE_FAILED","errorMessage":"Deserialize this data [%s] failed, please check the origin data","messagePattern":"Deserialize this data \\[(.+?)\\] failed, please check the origin data","errorType":"exception","errorClass":"FileConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/TextReadStrategy.java","lineNumber":266,"sourceCode":"                for (int i = 0; i < indexes.length; i++) {\n                    fields[i] = seaTunnelRow.getField(indexes[i]);\n                }\n                seaTunnelRow = new SeaTunnelRow(fields);\n            }\n            if (isMergePartition) {\n                int index = seaTunnelRowType.getTotalFields();\n                for (String value : partitionsMap.values()) {\n                    seaTunnelRow.setField(index++, value);\n                }\n            }\n            seaTunnelRow.setTableId(tableId);\n            output.collect(seaTunnelRow);\n        } catch (IOException e) {\n            String errorMsg =\n                    String.format(\n                            \"Deserialize this data [%s] failed, please check the origin data\",\n                            line);\n            throw new FileConnectorException(\n                    FileConnectorErrorCode.DATA_DESERIALIZE_FAILED, errorMsg, e);\n        }\n    }\n\n    @Override\n    public SeaTunnelRowType getSeaTunnelRowTypeInfo(String path) {\n        this.seaTunnelRowType = CatalogTableUtil.buildSimpleTextSchema();\n        this.seaTunnelRowTypeWithPartition =\n                mergePartitionTypes(getPathForPartitionInference(path), seaTunnelRowType);\n        initFormatter();\n        if (pluginConfig.hasPath(FileBaseSourceOptions.READ_COLUMNS.key())) {\n            throw new FileConnectorException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    \"When reading text files, if user has not specified schema information, \"\n                            + \"SeaTunnel will not support column projection\");\n        }\n        ReadonlyConfig readonlyConfig = ReadonlyConfig.fromConfig(pluginConfig);\n        TextDeserializationSchema.Builder builder =","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/TextReadStrategy.java#L248-L284","documentation":"TextReadStrategy.processLineData deserializes each raw text line per the configured field delimiters/schema; an IOException from the deserializer is wrapped as FileConnectorException(DATA_DESERIALIZE_FAILED) with the offending line. It means one line of the text file did not match the expected row format.","triggerScenarios":"A line whose field count or content cannot be parsed with the configured delimiter/field types (e.g. delimiter='\\t' but file uses ','; quoted fields; empty/extra trailing delimiter; encoding mismatch).","commonSituations":"Files exported with different delimiters than configured; schema/field-type declarations that don't match data; stray blank lines; mixed encodings; CSV-style quoting inside plain-text delimited files.","solutions":["Align the delimiter (field_delimiter) and encoding with the actual file content, inspecting a sample line shown in the error","Fix or skip the malformed line in the source file; check for blank/short lines at file ends","Verify declared field types match the data (e.g. numbers not containing thousand separators)","If the file is CSV with quoting, use the csv read strategy instead of text"],"exampleFix":"// before\nfield_delimiter = \",\"   // file actually uses tabs\n// after\nfield_delimiter = \"\\t\"  // matches origin data","handlingStrategy":"try-catch","validationCode":"// sample first line and compare delimiter counts to declared fields\ntry (BufferedReader r = Files.newBufferedReader(path, charset)) {\n    String line = r.readLine();\n    int cols = line.split(Pattern.quote(delimiter), -1).length;\n    if (cols != declaredFieldCount)\n        throw new IllegalStateException(\"Delimiter/field mismatch: got \" + cols + \" expected \" + declaredFieldCount);\n}","typeGuard":null,"tryCatchPattern":"try {\n    processLineData(line);\n} catch (FileConnectorException e) {\n    if (FileConnectorErrorCode.DATA_DESERIALIZE_FAILED.equals(e.getErrorCode())) {\n        LOG.warn(\"Skipping malformed line: {}\", line);\n    } else throw e;\n}","preventionTips":["Verify field_delimiter and encoding against a file sample before running jobs","Prefer the csv strategy for quoted CSV data instead of text","Declare schema field types that match actual data; strip blank trailing lines"],"tags":["deserialization","text-file","data-quality"],"backgroundTag":"schema-validation-failed","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"}