prestodb/presto · error · PrestoException

HIVE_FILESYSTEM_ERROR

HIVE_FILESYSTEM_ERROR

Error message

Failed getting FileSystem: 

What it means

HiveWriterFactory constructor eagerly obtains the FileSystem with the correct Configuration; any IOException there (bad HDFS URI, NameNode unreachable, Kerberos failure) is wrapped in this PrestoException — writer setup failed.

Source

Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java:307

                    sortFields,
                    sortOrders,
                    sortBufferSize,
                    maxOpenSortFiles,
                    pageSorter,
                    orcFileWriterFactory,
                    isSortedWriteToTempPathEnabled(session),
                    getSortedWriteTempPathSubdirectoryCount(session)));
        }
        else {
            this.sortingFileWriterFactory = Optional.empty();
        }

        // make sure the FileSystem is created with the correct Configuration object
        try {
            hdfsEnvironment.getFileSystem(session.getUser(), writePath, conf);
        }
        catch (IOException e) {
            throw new PrestoException(HIVE_FILESYSTEM_ERROR, "Failed getting FileSystem: " + writePath, e);
        }

        this.hiveWriterStats = requireNonNull(hiveWriterStats, "hiveWriterStats is null");

        // In Hive connector, bucket commit is fulfilled by writing to temporary file in TableWriterOperator, and rename in TableFinishOperator
        // (note Presto partition here loosely maps to Hive bucket)
        this.writeToTempFile = commitRequired;

        this.encryptionInformation = requireNonNull(encryptionInformation, "encryptionInformation is null");
    }

    public HiveWriter createWriter(Page partitionColumns, int position, OptionalInt bucketNumber)
    {
        if (bucketCount.isPresent()) {
            checkArgument(bucketNumber.isPresent(), "Bucket not provided for bucketed table");
            checkArgument(bucketNumber.getAsInt() < bucketCount.getAsInt(), "Bucket number %s must be less than bucket count %s", bucketNumber, bucketCount);
        }
        else {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check HDFS/configuration correctness for the write path
  2. Verify Kerberos credentials and permissions for the target user
  3. Inspect the nested IOException cause
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveWriterFactory.java:307 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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