{"record":{"id":"ee3f3abf62700a33","repo":"apache/flink","slug":"method-currentwatermark-isn-t-supported-in-proctim","errorCode":null,"errorMessage":"Method currentWatermark isn't supported in ProcTimeCommitTrigger.","messagePattern":"Method currentWatermark isn't supported in ProcTimeCommitTrigger\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/table/stream/ProcTimeCommitTrigger.java","lineNumber":116,"sourceCode":"        return new PredicateContext() {\n            @Override\n            public String partition() {\n                return partition;\n            }\n\n            @Override\n            public long createProcTime() {\n                return createProcTime;\n            }\n\n            @Override\n            public long currentProcTime() {\n                return procTimeService.getCurrentProcessingTime();\n            }\n\n            @Override\n            public long currentWatermark() {\n                throw new UnsupportedOperationException(\n                        \"Method currentWatermark isn't supported in ProcTimeCommitTrigger.\");\n            }\n        };\n    }\n\n    @Override\n    public void snapshotState(long checkpointId, long watermark) throws Exception {\n        pendingPartitionsState.update(Collections.singletonList(new HashMap<>(pendingPartitions)));\n    }\n\n    @Override\n    public List<String> endInput() {\n        ArrayList<String> partitions = new ArrayList<>(pendingPartitions.keySet());\n        pendingPartitions.clear();\n        return partitions;\n    }\n}\n","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/table/stream/ProcTimeCommitTrigger.java#L98-L134","documentation":"Thrown by ProcTimeCommitTrigger when a PartitionCommitPredicate calls currentWatermark() on the PredicateContext. The process-time trigger only provides partition(), createProcTime(), and currentProcTime(); it does not track watermarks because commit decisions are based on elapsed processing-time, not event-time. Calling currentWatermark() on this context is a semantic mismatch.","triggerScenarios":"Configuring sink.partition-commit-trigger = 'process-time' with a custom PartitionCommitPredicate that invokes predicateContext.currentWatermark().","commonSituations":"Using a partition-time-oriented predicate (e.g. the built-in PartitionTimeCommitPredicate) with a process-time trigger; or a custom predicate that was written for watermark semantics but deployed with process-time trigger.","solutions":["Switch sink.partition-commit-trigger to 'partition-time' so the watermark context is populated.","Rewrite the custom predicate to use createProcTime() and currentProcTime() instead of currentWatermark().","Use the built-in ProcTimeCommitPredicate which only relies on processing-time methods."],"exampleFix":"// before — watermark predicate used with process-time trigger\npublic boolean isPartitionCommittable(PredicateContext ctx) {\n    return ctx.currentWatermark() > partitionTime + commitDelay;\n}\n// after — use processing-time for process-time trigger\npublic boolean isPartitionCommittable(PredicateContext ctx) {\n    return ctx.currentProcTime() - ctx.createProcTime() >= commitDelayMs;\n}","handlingStrategy":"validation","validationCode":"// Verify predicate does not call currentWatermark when using process-time trigger\nString triggerType = conf.get(FileSystemConnectorOptions.SINK_PARTITION_COMMIT_TRIGGER).toString();\nif (\"PROCESS_TIME\".equals(triggerType) && predicateUsesWatermark(myPredicate)) {\n    throw new IllegalArgumentException(\n        \"Custom predicate requires watermark; set sink.partition-commit-trigger=partition-time\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When using process-time trigger, design predicates to use only partition(), createProcTime(), and currentProcTime().","Do not mix watermark-dependent predicates with the process-time trigger.","Test the predicate with the process-time PredicateContext before deployment."],"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"}