apache/flink · error · UnsupportedOperationException

Method currentProcTime isn't supported in PartitionTimeCommi

Error message

Method currentProcTime isn't supported in PartitionTimeCommitTrigger.

What it means

Thrown by PartitionTimeCommitTrigger when a PartitionCommitPredicate calls currentProcTime() on the PredicateContext. The partition-time trigger only supports partition() and currentWatermark(); current processing-time is not populated because commit decisions are driven by event-time watermarks, not the processing-time clock.

Source

Thrown at flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/table/stream/PartitionTimeCommitTrigger.java:135

        return needCommit;
    }

    private PredicateContext createPredicateContext(String partition, long watermark) {
        return new PredicateContext() {
            @Override
            public String partition() {
                return partition;
            }

            @Override
            public long createProcTime() {
                throw new UnsupportedOperationException(
                        "Method createProcTime isn't supported in PartitionTimeCommitTrigger.");
            }

            @Override
            public long currentProcTime() {
                throw new UnsupportedOperationException(
                        "Method currentProcTime isn't supported in PartitionTimeCommitTrigger.");
            }

            @Override
            public long currentWatermark() {
                return watermark;
            }
        };
    }

    @Override
    public void snapshotState(long checkpointId, long watermark) throws Exception {
        pendingPartitionsState.update(
                Collections.singletonList(new ArrayList<>(pendingPartitions)));

        watermarks.put(checkpointId, watermark);
        watermarksState.update(Collections.singletonList(new HashMap<>(watermarks)));
    }

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Switch sink.partition-commit-trigger to 'process-time' so currentProcTime() is populated.
  2. Remove currentProcTime() usage from the predicate and rely on currentWatermark() for partition-time semantics.
  3. Split predicates into separate implementations for partition-time vs process-time and select based on trigger type.

Example fix

// before — predicate mixes proc-time with partition-time trigger
public boolean isPartitionCommittable(PredicateContext ctx) {
    return ctx.currentProcTime() - ctx.createProcTime() > commitDelayMs;
}
// after — use watermark for partition-time trigger
public boolean isPartitionCommittable(PredicateContext ctx) {
    long partEpoch = extractor.extract(keys, extractPartitionValues(new Path(ctx.partition())))
        .atZone(zone).toInstant().toEpochMilli();
    return ctx.currentWatermark() > partEpoch + commitDelayMs;
}
Defensive patterns

Strategy: validation

Validate before calling

// Verify predicate does not call currentProcTime when using partition-time trigger
String triggerType = conf.get(FileSystemConnectorOptions.SINK_PARTITION_COMMIT_TRIGGER).toString();
if ("PARTITION_TIME".equals(triggerType)) {
    // ensure the predicate class only uses partition() and currentWatermark()
    validatePredicateContextMethods(myPredicateClass, Set.of("partition", "currentWatermark"));
}

Prevention

When it happens

Trigger: Configuring sink.partition-commit-trigger = 'partition-time' with a custom PartitionCommitPredicate that invokes predicateContext.currentProcTime() inside isPartitionCommittable().

Common situations: Migrating a custom predicate from process-time semantics to partition-time without removing currentProcTime() calls; or a predicate that mixes both time semantics indiscriminately.

Related errors


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/a62ab3a57e095599. Report an issue: GitHub.