{"record":{"id":"60d8caa2a7b2e3b2","repo":"prestodb/presto","slug":"hive-invalid-encryption-metadata-60d8ca","errorCode":"HIVE_INVALID_ENCRYPTION_METADATA","errorMessage":"Exactly one of table or column settings can be present. Both are present","messagePattern":"Exactly one of table or column settings can be present\\. Both are present","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/TableEncryptionProperties.java","lineNumber":40,"sourceCode":"import static com.facebook.presto.hive.EncryptionProperties.ENCRYPT_COLUMNS_KEY;\nimport static com.facebook.presto.hive.EncryptionProperties.ENCRYPT_TABLE_KEY;\nimport static com.facebook.presto.hive.HiveErrorCode.HIVE_INVALID_ENCRYPTION_METADATA;\nimport static com.facebook.presto.hive.HiveTableProperties.ENCRYPT_COLUMNS;\nimport static com.facebook.presto.hive.HiveTableProperties.ENCRYPT_TABLE;\nimport static java.util.Objects.requireNonNull;\n\npublic abstract class TableEncryptionProperties\n{\n    private final Optional<String> encryptTable;\n    private final Optional<ColumnEncryptionInformation> columnEncryptionInformation;\n\n    protected TableEncryptionProperties(Optional<String> encryptTable, Optional<ColumnEncryptionInformation> columnEncryptionInformation)\n    {\n        this.encryptTable = requireNonNull(encryptTable, \"encryptTable is null\");\n        this.columnEncryptionInformation = requireNonNull(columnEncryptionInformation, \"columnEncryptionInformation is null\");\n\n        if (encryptTable.isPresent() && columnEncryptionInformation.isPresent()) {\n            throw new PrestoException(HIVE_INVALID_ENCRYPTION_METADATA, \"Exactly one of table or column settings can be present. Both are present\");\n        }\n        else if (!encryptTable.isPresent() && !columnEncryptionInformation.isPresent()) {\n            throw new PrestoException(HIVE_INVALID_ENCRYPTION_METADATA, \"Exactly one of table or column settings can be present. None are present\");\n        }\n    }\n\n    public Optional<String> getEncryptTable()\n    {\n        return encryptTable;\n    }\n\n    public Optional<ColumnEncryptionInformation> getColumnEncryptionInformation()\n    {\n        return columnEncryptionInformation;\n    }\n\n    protected Map<String, String> getFormatSpecificHiveProperties()\n    {","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/TableEncryptionProperties.java#L22-L58","documentation":"TableEncryptionProperties.fromTableProperties invariant: encryption must specify either the table-level encrypt_table key or column-level encrypt_columns, not both; this message documents the both-present branch of that HIVE_INVALID_ENCRYPTION_METADATA check.","triggerScenarios":"Thrown at presto-hive/src/main/java/com/facebook/presto/hive/TableEncryptionProperties.java:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove one of encrypt_table or encrypt_columns from the table properties","Keep only the intended encryption granularity"],"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"}