{"record":{"id":"968060b311f7dcd6","repo":"prestodb/presto","slug":"hive-partition-read-only-968060","errorCode":"HIVE_PARTITION_READ_ONLY","errorMessage":"Unpartitioned Hive tables are immutable","messagePattern":"Unpartitioned Hive tables are immutable","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java","lineNumber":475,"sourceCode":"                        partitionName,\n                        schemaName,\n                        tableName,\n                        writeInfo.getTargetPath()));\n            }\n        }\n        return new WriterParameters(\n                UpdateMode.NEW,\n                createHiveSchema(dataColumns),\n                writeInfo,\n                fromHiveStorageFormat(storageFormat));\n    }\n\n    private WriterParameters getWriterParametersForExistingUnpartitionedTable(OptionalInt bucketNumber)\n    {\n        // Note: temporary table is always empty at this step\n        if (!table.getTableType().equals(TEMPORARY_TABLE)) {\n            if (immutablePartitions) {\n                throw new PrestoException(HIVE_PARTITION_READ_ONLY, \"Unpartitioned Hive tables are immutable\");\n            }\n        }\n        return new WriterParameters(\n                UpdateMode.APPEND,\n                getHiveSchema(table),\n                locationService.getTableWriteInfo(locationHandle),\n                fromHiveStorageFormat(storageFormat));\n    }\n\n    private WriterParameters getWriterParametersForExistingPartitionedTable(String partitionName, OptionalInt bucketNumber)\n    {\n        if (MetastoreUtil.isPrestoMaterializedView(table)) {\n            return getWriterParametersForOverwritePartition(partitionName);\n        }\n\n        switch (insertExistingPartitionsBehavior) {\n            case APPEND:\n                return getWriterParametersForAppendPartition(partitionName, bucketNumber);","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java#L457-L493","documentation":"getWriterParametersForExistingUnpartitionedTable: an insert/append was attempted against an existing unpartitioned (non-transactional) Hive table with update mode NEW; unpartitioned tables cannot receive new files this way, so writes are rejected.","triggerScenarios":"Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java:475 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Convert the table to a managed table","Recreate the data via CTAS into a managed table","Remove rows/rewrite instead of appending"],"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"}