apache/seatunnel · error · RuntimeException

Unsupported row kind.

Error message

Unsupported row kind.

What it means

StarRocksSinkOP.parse maps a SeaTunnel RowKind to the StarRocks stream-load __op value (UPSERT/DELETE/INSERT). RowKind covers INSERT, DELETE, UPDATE_AFTER, UPDATE_BEFORE; any other/null kind falls to default and throws a plain RuntimeException('Unsupported row kind.').

Source

Thrown at seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/serialize/StarRocksSinkOP.java:41

 * Reference
 * https://github.com/StarRocks/starrocks/blob/main/docs/loading/Load_to_Primary_Key_tables.md#upsert-and-delete
 */
public enum StarRocksSinkOP {
    UPSERT,
    DELETE;

    public static final String COLUMN_KEY = "__op";

    static StarRocksSinkOP parse(RowKind kind) {
        switch (kind) {
            case INSERT:
            case UPDATE_AFTER:
                return UPSERT;
            case DELETE:
            case UPDATE_BEFORE:
                return DELETE;
            default:
                throw new RuntimeException("Unsupported row kind.");
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Ensure the upstream source/transform always sets a valid RowKind (INSERT/UPDATE_AFTER/DELETE)
  2. Filter or normalize row kinds before the sink (e.g. drop UPDATE_BEFORE rows)
  3. Check which connector/transform produced the row and upgrade/fix it
  4. Catch this at job design time: CDC pipelines for StarRocks should emit UPSERT/DELETE-compatible kinds

Example fix

// before
row.setRowKind(null); // or unknown kind -> RuntimeException
// after
row.setRowKind(RowKind.INSERT); // or UPDATE_AFTER / DELETE
Defensive patterns

Strategy: try-catch

Validate before calling

if (row.getRowKind() == null) throw new IllegalStateException("Row has null RowKind before StarRocks sink");

Type guard

boolean hasSinkableRowKind(Row row) { RowKind k = row.getRowKind(); return k == RowKind.INSERT || k == RowKind.UPDATE_AFTER || k == RowKind.DELETE; }

Try / catch

try { sinkWriter.write(row); } catch (RuntimeException e) { if ("Unsupported row kind.".equals(e.getMessage())) { log.error("Row kind {} not sinkable; normalize upstream", row.getRowKind(), e); } throw e; }

Prevention

When it happens

Trigger: Row arriving at the sink with RowKind other than the four handled values (e.g. a null or future/unknown kind) during CDC or transform processing.

Common situations: Custom Source/Transform emitting rows with RowKind null or an unmapped kind feeding a StarRocks sink; CDC pipeline producing unexpected row kinds; bug in upstream connector emitting RowKind beyond the enum's known values.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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