prestodb/presto · error · PrestoException

HIVE_BAD_DATA

HIVE_BAD_DATA

Error message

Error parsing symlinks from: 

What it means

HIVE_BAD_DATA wrapping an IOException while reading symlink manifest files. Symlink-table partitions point to a manifest text file listing target paths; if listing/reading the symlink directory fails (missing file, permissions, network), Presto reports 'Error parsing symlinks from: <dir>'.

Source

Thrown at presto-hive/src/main/java/com/facebook/presto/hive/StoragePartitionLoader.java:741

                .map(Optional::get)
                .collect(toImmutableList());
    }

    private List<Path> getTargetPathsFromSymlink(ExtendedFileSystem fileSystem, Path symlinkDir, Optional<Partition> partition)
    {
        try {
            HiveDirectoryContext hiveDirectoryContext = new HiveDirectoryContext(
                    IGNORED,
                    isUseListDirectoryCache(session),
                    isSkipEmptyFilesEnabled(session),
                    hdfsContext.getIdentity(),
                    buildDirectoryContextProperties(session),
                    session.getRuntimeStats());
            Iterator<HiveFileInfo> manifestFileInfos = directoryLister.list(fileSystem, table, symlinkDir, partition, namenodeStats, hiveDirectoryContext);
            return readSymlinkPaths(fileSystem, manifestFileInfos);
        }
        catch (IOException e) {
            throw new PrestoException(HIVE_BAD_DATA, "Error parsing symlinks from: " + symlinkDir, e);
        }
    }

    private static Properties getPartitionSchema(Table table, Optional<Partition> partition)
    {
        return partition.map(value -> getHiveSchema(value, table)).orElseGet(() -> getHiveSchema(table));
    }

    public static class BucketSplitInfo
    {
        private final List<HiveColumnHandle> bucketColumns;
        private final int tableBucketCount;
        private final int readBucketCount;
        private final IntPredicate bucketFilter;

        public static Optional<BucketSplitInfo> createBucketSplitInfo(Optional<HiveBucketHandle> bucketHandle, Optional<HiveBucketing.HiveBucketFilter> bucketFilter)
        {
            requireNonNull(bucketHandle, "bucketHandle is null");

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the symlink target directory exists and is readable (hdfs dfs -ls on the path in the message)
  2. Fix HDFS permissions for the Presto service user on the symlink directory/manifest
  3. Repair the partition: re-register or regenerate the symlink manifest (ALTER TABLE ... REPAIR PARTITIONS or MSCK)
  4. Verify NameNode health/connectivity if the message coincides with network errors

Example fix

// before: manifest missing
partitions: location 'hdfs://nn/symlinks/p=1' -> p=1.lst deleted
// after
hdfs dfs -put p=1.lst hdfs://nn/symlinks/p=1/
-- or re-point the partition to a valid manifest location
Defensive patterns

Strategy: try-catch

Validate before calling

// before querying: verify symlink manifest readable
try (FSDataInputStream in = fs.open(new Path(symlinkDir, manifestName))) {
    String first = in.readLine();
    if (first == null) throw new IllegalStateException("Empty symlink manifest: " + symlinkDir);
}

Try / catch

try {
    session.execute(query);
} catch (PrestoException e) {
    if (HiveErrorCode.HIVE_BAD_DATA.toErrorCode().equals(e.getErrorCode())
            && e.getMessage().startsWith("Error parsing symlinks from:")) {
        // check HDFS connectivity/permissions and manifest presence, then retry
    } else throw e;
}

Prevention

When it happens

Trigger: getTargetPathsFromSymlink (from targetPaths) calls directoryLister.list/readSymlinkPaths and an IOException occurs reading the symlink manifest directory for the partition.

Common situations: Symlink manifest file deleted or moved after partition registration; HDFS permission changes; NameNode connectivity problems; malformed or empty symlink location configured on the partition.

Related errors


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