{"record":{"id":"986cfeebb7f294ef","repo":"prestodb/presto","slug":"hive-writer-open-error-986cfe","errorCode":"HIVE_WRITER_OPEN_ERROR","errorMessage":"Error creating RCFile file","messagePattern":"Error creating RCFile file","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/RcFileFileWriterFactory.java","lineNumber":171,"sourceCode":"                fileSystem.delete(path, false);\n                return null;\n            };\n\n            return Optional.of(new RcFileFileWriter(\n                    outputStream,\n                    rollbackAction,\n                    rcFileEncoding,\n                    fileColumnTypes,\n                    codecName,\n                    fileInputColumnIndexes,\n                    ImmutableMap.<String, String>builder()\n                            .put(MetastoreUtil.PRESTO_VERSION_NAME, nodeVersion.toString())\n                            .put(MetastoreUtil.PRESTO_QUERY_ID_NAME, session.getQueryId())\n                            .build(),\n                    validationInputFactory));\n        }\n        catch (Exception e) {\n            throw new PrestoException(HIVE_WRITER_OPEN_ERROR, \"Error creating RCFile file\", e);\n        }\n    }\n}\n","sourceCodeStart":153,"sourceCodeEnd":175,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/RcFileFileWriterFactory.java#L153-L175","documentation":"RcFileFileWriterFactory.createFileWriter() opens a new RCFile via the underlying record writer and wires up validation. Any exception while creating the RCFile (opening the output stream, creating the writer, building properties) is wrapped in HIVE_WRITER_OPEN_ERROR. The write never started, so nothing was produced for this output.","triggerScenarios":"Opening the target/staging HDFS file fails or constructing the RCFile record writer throws — e.g. HDFS quota exceeded, permission denied on the staging directory, missing parent directory, or invalid writer parameters.","commonSituations":"Insufficient HDFS quota or disk on the write path; wrong permissions on the table/staging directory; HDFS in safe mode or NameNode unreachable; misconfigured writer setup producing invalid parameters.","solutions":["Read the wrapped cause to identify the open failure (permissions, quota, connectivity) and fix that.","Verify the query user can write to the table's staging/write path in HDFS.","Check HDFS health (NameNode reachable, not in safe mode) and free quota/space.","Validate writer configuration (schema, compression) matches what the RCFile writer supports."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-check write permissions and quota before running the insert:\nhdfs dfs -test -w <staging_dir> && hdfs dfs -count -q <staging_dir>\n// In code: assert the user can create files in the table's write path and quota remains.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify HDFS write permissions for the query user on the table staging directory.","Keep sufficient HDFS quota/disk headroom on write paths.","Check NameNode health / safe-mode status before launching large writes."],"tags":["hive","rcfile","writer","open","io"],"backgroundTag":"writer-open-error","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"}