{"record":{"id":"efb925ab31886a5f","repo":"apache/seatunnel","slug":"all-fields-in-row-are-null-skipping","errorCode":null,"errorMessage":"All fields in row are null, skipping","messagePattern":"All fields in row are null, skipping","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/sink/DatabendSinkWriter.java","lineNumber":442,"sourceCode":"            if (preparedStatement == null) {\n                throw new DatabendConnectorException(\n                        DatabendConnectorErrorCode.SQL_OPERATION_FAILED,\n                        \"Failed to initialize PreparedStatement.\");\n            }\n\n            log.info(\"PreparedStatement initialized successfully\");\n        }\n\n        boolean allFieldsNull = true;\n        for (Object field : row.getFields()) {\n            if (field != null) {\n                allFieldsNull = false;\n                break;\n            }\n        }\n\n        if (allFieldsNull) {\n            log.warn(\"All fields in row are null, skipping\");\n            return;\n        }\n\n        processRow(row);\n    }\n\n    private String mapRowKindToAction(RowKind rowKind) {\n        switch (rowKind) {\n            case INSERT:\n                return \"insert\";\n            case UPDATE_AFTER:\n                return \"update\";\n            case DELETE:\n                return \"delete\";\n        }\n        return \"update_before\";\n    }\n","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/sink/DatabendSinkWriter.java#L424-L460","documentation":"In DatabendSinkWriter.processTraditionalRow() (traditional/batch insert mode), the writer checks whether every field of the row is null. If so, it logs this warning and returns, skipping the row entirely instead of executing an INSERT of all-NULL values. This is a data-quality guard: Databend tables with NOT NULL constraints would reject such rows anyway.","triggerScenarios":"A SeaTunnelRow whose fields array is non-empty but every element is null is processed in traditional (non-CDC) mode.","commonSituations":"CDC/op field extraction leaving only null values; misaligned schema mapping where all columns map to nonexistent keys; upstream data corruption.","solutions":["Fix upstream schema mapping so fields are populated correctly","Inspect a sample of the incoming rows (enable debug logging) to find which producer emits all-null rows","Add explicit NOT NULL defaults upstream or filter such rows before the sink","If all-null rows are legitimate, change the check to insert default values instead of skipping"],"exampleFix":"// before\nif (allFieldsNull) {\n    log.warn(\"All fields in row are null, skipping\");\n    return;\n}\n// after\nif (allFieldsNull) {\n    log.warn(\"All fields in row are null, skipping. Row type: {}\", row.getRowType());\n    allNullRowCounter.inc();\n    return;\n}","handlingStrategy":"validation","validationCode":"// validate row content before pipeline reaches traditional sink path\nboolean hasData(SeaTunnelRow row) {\n    if (row == null || row.getFields() == null) return false;\n    for (Object f : row.getFields()) { if (f != null) return true; }\n    return false;\n}","typeGuard":"Object firstNonNull(SeaTunnelRow row) {\n    for (Object f : row.getFields()) { if (f != null) return f; }\n    return null;\n}","tryCatchPattern":"// not applicable: the writer logs a warning and returns; no exception is thrown","preventionTips":["Verify schema mapping so fields are actually populated","Coalesce or default null columns in a SQL transform before the sink","Check CDC record parsing when using CDC mode sources"],"tags":["data-quality","null-values","skip","traditional-mode"],"backgroundTag":"empty-required-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}