{"record":{"id":"6497726db8ad5b39","repo":"apache/seatunnel","slug":"table-write-record-failed","errorCode":"TABLE_WRITE_RECORD_FAILED","errorMessage":"This record ${element} failed to be written","messagePattern":"This record (.+?) failed to be written","errorType":"error_code","errorClass":"PaimonConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink/PaimonSinkWriter.java","lineNumber":257,"sourceCode":"                            // sequence number.\n                            PaimonBucketAssigner bucketAssigner =\n                                    paimonBucketAssignerFactory.getBucketAssigner(\n                                            paimonTablePath,\n                                            rowAssignerChannelComputer.channel(rowData));\n                            // When multiple threads call assigner.assign() simultaneously, they can\n                            // corrupt the internal hash map structure, leading to the\n                            // ArrayIndexOutOfBoundsException during rehashing operations\n                            synchronized (bucketAssigner) {\n                                tableWrite.write(rowData, bucketAssigner.assign(rowData));\n                                bucketAssigners.add(bucketAssigner);\n                            }\n                        } else {\n                            tableWrite.write(rowData);\n                        }\n                        return null;\n                    });\n        } catch (Exception e) {\n            throw new PaimonConnectorException(\n                    PaimonConnectorErrorCode.TABLE_WRITE_RECORD_FAILED,\n                    \"This record \" + element + \" failed to be written\",\n                    e);\n        }\n    }\n\n    @Override\n    public void applySchemaChange(SchemaChangeEvent event) throws IOException {\n        this.sourceTableSchema =\n                new AlterPaimonTableSchemaEventHandler(\n                                sourceTableSchema,\n                                paimonCatalog,\n                                sinkPaimonTableSchema,\n                                paimonTablePath,\n                                paimonSinkConfig.getBranch())\n                        .apply(event);\n        reOpenTableWrite();\n    }","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink/PaimonSinkWriter.java#L239-L275","documentation":"PaimonSinkWriter.write wraps any exception from `tableWrite.write(rowData)` (or the upstream/downsert converters it invokes) into TABLE_WRITE_RECORD_FAILED, attaching the failing SeaTunnelRow. This signals the record itself could not be written to the Paimon table writer.","triggerScenarios":"Calling write() with a SeaTunnelRow whose schema does not match the Paimon table (wrong column count/types, null in a NOT NULL primary-key field, partition value mismatch), or an underlying IO/error inside Paimon's TableWrite.","commonSituations":"Upstream schema changed after the sink table was created; NULL primary key values; row produced by a transform has wrong types; data newer than a schema-change point landing mid-job.","solutions":["Align the source/transform output row type with the Paimon table schema (column order, count, types)","Ensure primary-key and partition columns are non-null in every record","Enable `schema_save_mode`/correct schema evolution or manually ALTER the Paimon table to match the data","Inspect the wrapped cause (`e`) for the concrete Paimon error"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { sinkWriter.write(element); } catch (PaimonConnectorException e) { if (PaimonConnectorErrorCode.TABLE_WRITE_RECORD_FAILED.equals(e.getErrorCode())) { log.error(\"Row rejected by Paimon: {}\", element, e.getCause()); /* route to DLQ or fail pipeline */ } else { throw e; } }","preventionTips":["Keep source and Paimon table schemas in sync (types, order, nullability)","Ensure primary-key/partition fields are never null","Add schema-evolution handling or recreate tables on schema drift"],"tags":["paimon","sink","write"],"backgroundTag":"database-write-failed","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"}