apache/seatunnel · warning · UnsupportedOperationException

Not implemented

Error message

Not implemented

What it means

MetadataColumn.reSourceType is an unsupported operation: re-declaring the source type only makes sense for physical columns, so calling it on a MetadataColumn always throws UnsupportedOperationException.

Source

Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/MetadataColumn.java:80

    @Override
    public Column copy() {
        return MetadataColumn.of(name, dataType, columnLength, nullable, defaultValue, comment);
    }

    @Override
    public Column rename(String newColumnName) {
        return MetadataColumn.of(
                newColumnName, dataType, columnLength, nullable, defaultValue, comment);
    }

    public PhysicalColumn toPhysicalColumn() {
        return PhysicalColumn.of(
                name, dataType, columnLength, scale, nullable, defaultValue, comment);
    }

    @Override
    public Column reSourceType(String sourceType) {
        throw new UnsupportedOperationException("Not implemented");
    }

    @Override
    public Column copyWithComment(String newComment) {
        return MetadataColumn.of(name, dataType, columnLength, nullable, defaultValue, newComment);
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Skip MetadataColumn instances when rewriting source types (only apply to PhysicalColumn)
  2. Implement reSourceType in custom column classes if the operation is meaningful
  3. Guard with instanceof before calling reSourceType

Example fix

// before
columns.forEach(c -> c.reSourceType(srcType));
// after
columns.stream()
    .filter(c -> c instanceof PhysicalColumn)
    .forEach(c -> c.reSourceType(srcType));
Defensive patterns

Strategy: type-guard

Type guard

boolean canReSource = column instanceof PhysicalColumn;

Try / catch

try { col.reSourceType(t); } catch (UnsupportedOperationException e) { /* skip metadata columns */ }

Prevention

When it happens

Trigger: Calling reSourceType(sourceType) on a MetadataColumn instance, usually by schema-conversion code that uniformly rewrites source types across all columns of a table.

Common situations: Type-mapping/normalization passes over TableSchema that don't distinguish physical vs metadata columns; refactoring code that switched from PhysicalColumn to MetadataColumn handling without updating the call site.

Related errors


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