{"record":{"id":"99e2c89fa09599b6","repo":"prestodb/presto","slug":"setpartitionleases-is-not-supported-in-recordinghi","errorCode":null,"errorMessage":"setPartitionLeases is not supported in RecordingHiveMetastore","messagePattern":"setPartitionLeases is not supported in RecordingHiveMetastore","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/RecordingHiveMetastore.java","lineNumber":506,"sourceCode":"    public void revokeRoles(MetastoreContext metastoreContext, Set<String> roles, Set<PrestoPrincipal> grantees, boolean adminOptionFor, PrestoPrincipal grantor)\n    {\n        verifyRecordingMode();\n        delegate.revokeRoles(metastoreContext, roles, grantees, adminOptionFor, grantor);\n    }\n\n    @Override\n    public Set<RoleGrant> listRoleGrants(MetastoreContext metastoreContext, PrestoPrincipal principal)\n    {\n        return loadValue(\n                roleGrantsCache,\n                principal,\n                () -> delegate.listRoleGrants(metastoreContext, principal));\n    }\n\n    @Override\n    public void setPartitionLeases(MetastoreContext metastoreContext, String databaseName, String tableName, Map<String, String> partitionNameToLocation, Duration leaseDuration)\n    {\n        throw new UnsupportedOperationException(\"setPartitionLeases is not supported in RecordingHiveMetastore\");\n    }\n\n    @Override\n    public MetastoreOperationResult dropConstraint(MetastoreContext metastoreContext, String databaseName, String tableName, String constraintName)\n    {\n        verifyRecordingMode();\n        return delegate.dropConstraint(metastoreContext, databaseName, tableName, constraintName);\n    }\n\n    @Override\n    public MetastoreOperationResult addConstraint(MetastoreContext metastoreContext, String databaseName, String tableName, TableConstraint<String> tableConstraint)\n    {\n        verifyRecordingMode();\n        return delegate.addConstraint(metastoreContext, databaseName, tableName, tableConstraint);\n    }\n\n    private <K, V> V loadValue(Cache<K, V> cache, K key, Supplier<V> valueSupplier)\n    {","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/RecordingHiveMetastore.java#L488-L524","documentation":"setPartitionLeases is a metastore write operation that RecordingHiveMetastore deliberately does not support (it neither records nor replays it), so calling it always raises this UnsupportedOperationException regardless of mode.","triggerScenarios":"Thrown at presto-hive-metastore/src/main/java/com/facebook/presto/hive/metastore/RecordingHiveMetastore.java:506 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not use setPartitionLeases through a RecordingHiveMetastore wrapper; call the underlying metastore directly","Remove or bypass lease-management calls when running with recording/replay enabled"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}