{"record":{"id":"a62ab3a57e095599","repo":"apache/flink","slug":"method-currentproctime-isn-t-supported-in-partitio","errorCode":null,"errorMessage":"Method currentProcTime isn't supported in PartitionTimeCommitTrigger.","messagePattern":"Method currentProcTime isn't supported in PartitionTimeCommitTrigger\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/table/stream/PartitionTimeCommitTrigger.java","lineNumber":135,"sourceCode":"        return needCommit;\n    }\n\n    private PredicateContext createPredicateContext(String partition, long watermark) {\n        return new PredicateContext() {\n            @Override\n            public String partition() {\n                return partition;\n            }\n\n            @Override\n            public long createProcTime() {\n                throw new UnsupportedOperationException(\n                        \"Method createProcTime isn't supported in PartitionTimeCommitTrigger.\");\n            }\n\n            @Override\n            public long currentProcTime() {\n                throw new UnsupportedOperationException(\n                        \"Method currentProcTime isn't supported in PartitionTimeCommitTrigger.\");\n            }\n\n            @Override\n            public long currentWatermark() {\n                return watermark;\n            }\n        };\n    }\n\n    @Override\n    public void snapshotState(long checkpointId, long watermark) throws Exception {\n        pendingPartitionsState.update(\n                Collections.singletonList(new ArrayList<>(pendingPartitions)));\n\n        watermarks.put(checkpointId, watermark);\n        watermarksState.update(Collections.singletonList(new HashMap<>(watermarks)));\n    }","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/table/stream/PartitionTimeCommitTrigger.java#L117-L153","documentation":"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.","triggerScenarios":"Configuring sink.partition-commit-trigger = 'partition-time' with a custom PartitionCommitPredicate that invokes predicateContext.currentProcTime() inside isPartitionCommittable().","commonSituations":"Migrating a custom predicate from process-time semantics to partition-time without removing currentProcTime() calls; or a predicate that mixes both time semantics indiscriminately.","solutions":["Switch sink.partition-commit-trigger to 'process-time' so currentProcTime() is populated.","Remove currentProcTime() usage from the predicate and rely on currentWatermark() for partition-time semantics.","Split predicates into separate implementations for partition-time vs process-time and select based on trigger type."],"exampleFix":"// before — predicate mixes proc-time with partition-time trigger\npublic boolean isPartitionCommittable(PredicateContext ctx) {\n    return ctx.currentProcTime() - ctx.createProcTime() > commitDelayMs;\n}\n// after — use watermark for partition-time trigger\npublic boolean isPartitionCommittable(PredicateContext ctx) {\n    long partEpoch = extractor.extract(keys, extractPartitionValues(new Path(ctx.partition())))\n        .atZone(zone).toInstant().toEpochMilli();\n    return ctx.currentWatermark() > partEpoch + commitDelayMs;\n}","handlingStrategy":"validation","validationCode":"// Verify predicate does not call currentProcTime when using partition-time trigger\nString triggerType = conf.get(FileSystemConnectorOptions.SINK_PARTITION_COMMIT_TRIGGER).toString();\nif (\"PARTITION_TIME\".equals(triggerType)) {\n    // ensure the predicate class only uses partition() and currentWatermark()\n    validatePredicateContextMethods(myPredicateClass, Set.of(\"partition\", \"currentWatermark\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When using partition-time trigger, design predicates to use only partition() and currentWatermark().","Document which context methods each predicate implementation depends on.","Run an integration test that exercises the predicate with the actual trigger before deploying."],"tags":["filesystem-connector","partition-commit","configuration","internal-api"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}