apache/seatunnel · error · UnsupportedOperationException

not supported create new Offset by filename and position.

Error message

not supported create new Offset by filename and position.

What it means

LsnOffsetFactory.specific(String filename, Long position) is unimplemented for SQL Server because LSN offsets are not filename/position pairs (that model is binlog/log-file specific). Calling it always throws UnsupportedOperationException.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-sqlserver/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/sqlserver/source/offset/LsnOffsetFactory.java:69

    }

    @Override
    public Offset latest() {
        try (JdbcConnection jdbcConnection = dialect.openJdbcConnection(sourceConfig)) {
            return SqlServerUtils.currentLsn((SqlServerConnection) jdbcConnection);
        } catch (Exception e) {
            throw new RuntimeException("Read the binlog offset error", e);
        }
    }

    @Override
    public Offset specific(Map<String, String> offset) {
        return LsnOffset.valueOf(offset);
    }

    @Override
    public Offset specific(String filename, Long position) {
        throw new UnsupportedOperationException(
                "not supported create new Offset by filename and position.");
    }

    @Override
    public Offset timestamp(long timestamp) {
        try (JdbcConnection jdbcConnection = dialect.openJdbcConnection(sourceConfig)) {
            return SqlServerUtils.timestampToLsn(
                    (SqlServerConnection) jdbcConnection,
                    timestamp,
                    sourceConfig.getServerTimeZone());
        } catch (Exception e) {
            throw new RuntimeException("Convert timestamp to LSN offset error", e);
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Use LsnOffsetFactory.specific(Map<String,String> offset) with an LSN-based offset map instead
  2. Restore from a saved SeaTunnel CDC offset containing the LSN key rather than filename/position
  3. Re-run from snapshot/latest if no valid LSN offset exists
  4. Do not call the filename/position overload in SQL Server code paths

Example fix

// before
Offset o = offsetFactory.specific("000001.log", 42L); // throws
// after
Map<String,String> off = new HashMap<>();
off.put("lsn", "00000026:00000ab8:0003");
Offset o = offsetFactory.specific(off);
Defensive patterns

Strategy: type-guard

Validate before calling

// only use filename/position offsets for engines that support them (e.g. MySQL binlog)
if (offsetFactory instanceof LsnOffsetFactory) {
    // must use specific(Map<String,String>) with LSN keys
}

Type guard

boolean supportsFilenamePosition(OffsetFactory f) {
    return !(f instanceof LsnOffsetFactory); // SQL Server factory rejects it
}

Try / catch

try {
    offset = factory.specific(filename, position);
} catch (UnsupportedOperationException e) {
    Map<String,String> lsnOffset = loadLsnOffsetFromCheckpoint();
    offset = factory.specific(lsnOffset);
}

Prevention

When it happens

Trigger: Any code path (typically a restore-from-offset API or framework fallback that identifies offsets by filename+position) invokes specific(filename, position) on the SQL Server offset factory.

Common situations: Porting logic written for MySQL binlog filenames to SQL Server; framework code that assumes the filename/position offset model; manual checkpoint restore attempts using file-based offsets.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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