apache/seatunnel · error · UnsupportedOperationException

not supported create new Offset by timestamp.

Error message

not supported create new Offset by timestamp.

What it means

LsnOffsetFactory cannot translate an arbitrary timestamp into a PostgreSQL LSN offset, so timestamp(long) always throws UnsupportedOperationException. LSN offsets are derived from the current WAL position, not from wall-clock time.

Source

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

                SourceInfo.TIMESTAMP_USEC_KEY,
                String.valueOf(Conversions.toEpochMicros(Instant.MIN)));
        return LsnOffset.of(offsetMap);
    }

    @Override
    public Offset specific(Map<String, String> offset) {
        return new LsnOffset(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) {
        throw new UnsupportedOperationException("not supported create new Offset by timestamp.");
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Start from `latest()` or a previously saved LSN offset (specific(Map)) instead of a timestamp.
  2. To approximate a time-based start, find the corresponding LSN externally (e.g. pg_waldump or pg_current_wal_lsn near the time) and supply it via specific(Map).
  3. If timestamp start is a hard requirement, use a connector/engine version that supports it or snapshot + replay from an earlier saved checkpoint.

Example fix

// before
Offset o = factory.timestamp(1700000000000L);
// after
Map<String,String> offsetMap = new HashMap<>();
offsetMap.put("lsn", savedLsn);
Offset o = factory.specific(offsetMap);
Defensive patterns

Strategy: type-guard

Validate before calling

if (startMode == TIMESTAMP) { throw new IllegalArgumentException("PostgreSQL CDC does not support start-from-timestamp"); }

Try / catch

try {
    factory.timestamp(ts);
} catch (UnsupportedOperationException e) {
    // use latest() or a saved LSN offset instead
}

Prevention

When it happens

Trigger: Calling `offsetFactory.timestamp(millis)` directly, or a framework feature (e.g. start-from-timestamp) that relies on timestamp-to-offset mapping against a PostgreSQL CDC source.

Common situations: Configuring a job to 'start from a given time'; porting MySQL CDC start-timestamp logic to PostgreSQL; generic tooling that builds offsets from timestamps.

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/74f209568860451f. Report an issue: GitHub.