prestodb/presto · error · PrestoException

HIVE_WRITER_OPEN_ERROR

HIVE_WRITER_OPEN_ERROR

Error message

Error creating RCFile file

What it means

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.

Source

Thrown at presto-hive/src/main/java/com/facebook/presto/hive/RcFileFileWriterFactory.java:171

                fileSystem.delete(path, false);
                return null;
            };

            return Optional.of(new RcFileFileWriter(
                    outputStream,
                    rollbackAction,
                    rcFileEncoding,
                    fileColumnTypes,
                    codecName,
                    fileInputColumnIndexes,
                    ImmutableMap.<String, String>builder()
                            .put(MetastoreUtil.PRESTO_VERSION_NAME, nodeVersion.toString())
                            .put(MetastoreUtil.PRESTO_QUERY_ID_NAME, session.getQueryId())
                            .build(),
                    validationInputFactory));
        }
        catch (Exception e) {
            throw new PrestoException(HIVE_WRITER_OPEN_ERROR, "Error creating RCFile file", e);
        }
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Read the wrapped cause to identify the open failure (permissions, quota, connectivity) and fix that.
  2. Verify the query user can write to the table's staging/write path in HDFS.
  3. Check HDFS health (NameNode reachable, not in safe mode) and free quota/space.
  4. Validate writer configuration (schema, compression) matches what the RCFile writer supports.
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check write permissions and quota before running the insert:
hdfs dfs -test -w <staging_dir> && hdfs dfs -count -q <staging_dir>
// In code: assert the user can create files in the table's write path and quota remains.

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/986cfeebb7f294ef. Report an issue: GitHub.