apache/seatunnel · error · PaimonConnectorException

TABLE_WRITE_RECORD_FAILED

TABLE_WRITE_RECORD_FAILED

Error message

This record ${element} failed to be written

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/sink/PaimonSinkWriter.java:257

                            // sequence number.
                            PaimonBucketAssigner bucketAssigner =
                                    paimonBucketAssignerFactory.getBucketAssigner(
                                            paimonTablePath,
                                            rowAssignerChannelComputer.channel(rowData));
                            // When multiple threads call assigner.assign() simultaneously, they can
                            // corrupt the internal hash map structure, leading to the
                            // ArrayIndexOutOfBoundsException during rehashing operations
                            synchronized (bucketAssigner) {
                                tableWrite.write(rowData, bucketAssigner.assign(rowData));
                                bucketAssigners.add(bucketAssigner);
                            }
                        } else {
                            tableWrite.write(rowData);
                        }
                        return null;
                    });
        } catch (Exception e) {
            throw new PaimonConnectorException(
                    PaimonConnectorErrorCode.TABLE_WRITE_RECORD_FAILED,
                    "This record " + element + " failed to be written",
                    e);
        }
    }

    @Override
    public void applySchemaChange(SchemaChangeEvent event) throws IOException {
        this.sourceTableSchema =
                new AlterPaimonTableSchemaEventHandler(
                                sourceTableSchema,
                                paimonCatalog,
                                sinkPaimonTableSchema,
                                paimonTablePath,
                                paimonSinkConfig.getBranch())
                        .apply(event);
        reOpenTableWrite();
    }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Align the source/transform output row type with the Paimon table schema (column order, count, types)
  2. Ensure primary-key and partition columns are non-null in every record
  3. Enable `schema_save_mode`/correct schema evolution or manually ALTER the Paimon table to match the data
  4. Inspect the wrapped cause (`e`) for the concrete Paimon error

Example fix

null
Defensive patterns

Strategy: try-catch

Try / catch

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; } }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/6497726db8ad5b39. Report an issue: GitHub.