{"record":{"id":"f6b0d4ec150cfd63","repo":"apache/seatunnel","slug":"received-empty-row-data-skipping","errorCode":null,"errorMessage":"Received empty row data, skipping","messagePattern":"Received empty row data, 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":337,"sourceCode":"                tableSchema.getColumns().stream()\n                        .map(column -> \"`\" + column.getName() + \"`\")\n                        .collect(Collectors.toList());\n\n        String placeholders = String.join(\", \", Collections.nCopies(columnNames.size(), \"?\"));\n\n        return String.format(\n                \"INSERT INTO %s (%s) VALUES (%s)\",\n                tableName, String.join(\", \", columnNames), placeholders);\n    }\n\n    @Override\n    public void write(SeaTunnelRow row) {\n        try {\n            log.info(\"Writing row: {}\", row);\n\n            // check if row is null or empty\n            if (row == null || row.getFields() == null || row.getFields().length == 0) {\n                log.warn(\"Received empty row data, skipping\");\n                return;\n            }\n\n            if (isCdcMode) {\n                processCdcRow(row);\n            } else {\n                processTraditionalRow(row);\n            }\n\n            batchCount++;\n            log.info(\"Batch count after adding row: {}\", batchCount);\n\n            if (batchCount >= batchSize) {\n                log.info(\"Batch size {} reached, executing batch\", batchSize);\n                executeBatch();\n                log.info(\"Batch executed successfully\");\n            }\n        } catch (Exception e) {","sourceCodeStart":319,"sourceCodeEnd":355,"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#L319-L355","documentation":"DatabendSinkWriter.write() skips rows that are null, have null fields array, or zero fields, logging this warning and returning without error. This guards the JDBC insert path against malformed upstream data that would otherwise cause a NullPointerException or an empty INSERT. The record is silently dropped from the sink output.","triggerScenarios":"An upstream transform or source emits a null SeaTunnelRow, or a row constructed with new SeaTunnelRow(0) / null fields array reaches the Databend sink.","commonSituations":"Misconfigured source producing empty rows; transform (e.g. SQL/Filter) emitting nulls for filtered-out records; deserialization bugs producing empty field arrays.","solutions":["Inspect the upstream source/transform to find why empty rows are emitted and filter them there","Add a Filter/SQL transform before the sink to drop null rows explicitly","Check row deserialization in the source (e.g. CDC format parsing) for bugs producing empty rows","If these rows should never exist, enable stricter validation upstream so the job fails fast and surfaces the producer"],"exampleFix":"// before\nif (row == null || row.getFields() == null || row.getFields().length == 0) {\n    log.warn(\"Received empty row data, skipping\");\n    return;\n}\n// after\nif (row == null || row.getFields() == null || row.getFields().length == 0) {\n    log.warn(\"Received empty row data, skipping. Upstream record: {}\", row);\n    emptyRowCounter.inc();\n    return;\n}","handlingStrategy":"validation","validationCode":"// before sending to sink, validate rows upstream\nif (row == null || row.getFields() == null || row.getFields().length == 0) {\n    throw new IllegalArgumentException(\"Upstream produced empty SeaTunnelRow\");\n}","typeGuard":"boolean isWritable(SeaTunnelRow row) {\n    return row != null && row.getFields() != null && row.getFields().length > 0;\n}","tryCatchPattern":"// not applicable: warning is logged and row skipped; no exception propagates","preventionTips":["Audit upstream transforms for null emissions","Add a Filter transform to drop empty rows explicitly before the sink","Track skipped-row counts in sink metrics"],"tags":["data-quality","null-row","skip","databend"],"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"}