{"record":{"id":"a1b0f59d161a9d36","repo":"apache/flink","slug":"method-createproctime-isn-t-supported-in-partition","errorCode":null,"errorMessage":"Method createProcTime isn't supported in PartitionTimeCommitTrigger.","messagePattern":"Method createProcTime 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":129,"sourceCode":"            PredicateContext predicateContext = createPredicateContext(partition, watermark);\n            if (partitionCommitPredicate.isPartitionCommittable(predicateContext)) {\n                needCommit.add(partition);\n                iter.remove();\n            }\n        }\n        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 {","sourceCodeStart":111,"sourceCodeEnd":147,"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#L111-L147","documentation":"Thrown by PartitionTimeCommitTrigger when a PartitionCommitPredicate calls createProcTime() on the PredicateContext. The partition-time trigger only provides partition() and currentWatermark() because it decides commits by comparing the partition's derived time against the event-time watermark; creation processing-time is irrelevant to that decision. Any predicate that depends on processing-time will hit this UnsupportedOperationException.","triggerScenarios":"Configuring sink.partition-commit-trigger = 'partition-time' while supplying a custom PartitionCommitPredicate (via sink.partition-commit-policy-class) whose isPartitionCommittable() calls predicateContext.createProcTime().","commonSituations":"Reusing a process-time-oriented custom predicate against a partition-time trigger without adjusting it; or switching the trigger type from process-time to partition-time while keeping the same predicate.","solutions":["Switch sink.partition-commit-trigger to 'process-time' if the predicate genuinely needs creation processing-time.","Rewrite the custom predicate to rely only on partition() and currentWatermark() when used with the partition-time trigger.","Use PartitionCommitPredicate.createPredicateContext(partition, createProcTime, currentProcTime, watermark) in tests to supply all four values, avoiding the partial context."],"exampleFix":"// before — custom predicate used with partition-time trigger\npublic boolean isPartitionCommittable(PredicateContext ctx) {\n    long age = procTimeService.getCurrentProcessingTime() - ctx.createProcTime();\n    return age > commitDelay;\n}\n// after — switch trigger to process-time, or rewrite predicate to use watermark\npublic boolean isPartitionCommittable(PredicateContext ctx) {\n    LocalDateTime partTime = extractor.extract(partitionKeys, extractPartitionValues(new Path(ctx.partition())));\n    return ctx.currentWatermark() > partTime.atZone(zone).toInstant().toEpochMilli() + commitDelay;\n}","handlingStrategy":"validation","validationCode":"// Before using a custom predicate, verify it matches the trigger type\nString triggerType = conf.get(FileSystemConnectorOptions.SINK_PARTITION_COMMIT_TRIGGER).toString();\nif (\"PARTITION_TIME\".equals(triggerType) && predicateUsesProcTime(myPredicate)) {\n    throw new IllegalArgumentException(\n        \"Custom predicate requires processing-time; set sink.partition-commit-trigger=process-time\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match the predicate's time semantics to the commit trigger type: partition-time predicates use only partition() and currentWatermark().","Unit test custom predicates against the exact PredicateContext the trigger will build.","Do not reuse a process-time predicate with a partition-time trigger without adapting it."],"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"}