apache/seatunnel · error · org.apache.seatunnel.connectors.seatunnel.maxcompute.exception.MaxcomputeConnectorException

CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT

CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT

Error message

field not found in written table: %s,rowType: %s

What it means

While mapping a SeaTunnelRow to a MaxCompute row, getMaxcomputeRowData looks up each field name (by position) in the target ODPS TableSchema; if the writer's SeaTunnelRowType contains a field absent from the physical table, it throws MaxcomputeConnectorException(ILLEGAL_ARGUMENT, 'field not found in written table: <field>,rowType: <value>').

Source

Thrown at seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/util/MaxcomputeTypeMapper.java:79

    public static SeaTunnelRow getSeaTunnelRowData(Record rs, SeaTunnelRowType typeInfo) {
        List<Object> fields = new ArrayList<>();
        for (int i = 0; i < typeInfo.getTotalFields(); i++) {
            String typeName = typeInfo.getFieldName(i);
            fields.add(resolveObject2SeaTunnel(rs.get(typeName), typeInfo.getFieldType(i)));
        }
        return new SeaTunnelRow(fields.toArray());
    }

    public static Record getMaxcomputeRowData(
            Record record,
            SeaTunnelRow seaTunnelRow,
            TableSchema tableSchema,
            SeaTunnelRowType rowType,
            FormatterContext formatterContext) {
        for (int i = 0; i < seaTunnelRow.getFields().length; i++) {
            String fieldName = rowType.getFieldName(i);
            if (!tableSchema.containsColumn(fieldName)) {
                throw new MaxcomputeConnectorException(
                        CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,
                        String.format(
                                "field not found in written table: %s,rowType: %s",
                                fieldName, seaTunnelRow.getField(i)));
            }
            Column column = tableSchema.getColumn(fieldName);

            record.set(
                    tableSchema.getColumnIndex(fieldName),
                    resolveObject2Maxcompute(
                            seaTunnelRow.getField(i), column.getTypeInfo(), formatterContext));
        }
        return record;
    }

    public static SeaTunnelRowType getSeaTunnelRowType(ReadonlyConfig config) {
        Table table = MaxcomputeUtil.getTable(config);
        TableSchema tableSchema = table.getSchema();

View on GitHub (pinned to cf67b549a7)

Solutions

  1. ALTER TABLE the MaxCompute table to add the missing column (ADD COLUMNS)
  2. Reconcile the SeaTunnel row type with the table schema (drop/rename the extra field via a transform or corrected source config)
  3. Verify table_path points at the intended table and environment
  4. Regenerate the ODPS table from the catalog create statement matching the current schema

Example fix

// before
seaTunnelRowType: [id, name, new_col]  // ODPS table lacks new_col
// after
ALTER TABLE my_table ADD COLUMNS IF NOT EXISTS (new_col STRING);
Defensive patterns

Strategy: validation

Validate before calling

for (String name : rowType.getFieldNames()) {
    if (!tableSchema.containsColumn(name)) {
        throw new IllegalStateException("ODPS table missing column: " + name);
    }
}

Try / catch

try { mapper.getMaxcomputeRowData(row, tableSchema, rowType, ctx); }
catch (MaxcomputeConnectorException e) {
    throw new SchemaEvolutionException("Alter the MaxCompute table or drop the extra field", e);
}

Prevention

When it happens

Trigger: Downstream MaxCompute table schema does not contain a column present in the SeaTunnel row type — e.g., the source added a column after the ODPS table was created, or the sink was pointed at a different table than intended.

Common situations: Source schema evolved (new column) while the MaxCompute table was not altered; typos in transform-generated field names; writing to a table in a different project/environment with an older schema.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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