{"record":{"id":"3350c74259c089bf","repo":"prestodb/presto","slug":"hive-bad-data-3350c7","errorCode":"HIVE_BAD_DATA","errorMessage":"Error parsing symlinks from: ","messagePattern":"Error parsing symlinks from: ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/StoragePartitionLoader.java","lineNumber":741,"sourceCode":"                .map(Optional::get)\n                .collect(toImmutableList());\n    }\n\n    private List<Path> getTargetPathsFromSymlink(ExtendedFileSystem fileSystem, Path symlinkDir, Optional<Partition> partition)\n    {\n        try {\n            HiveDirectoryContext hiveDirectoryContext = new HiveDirectoryContext(\n                    IGNORED,\n                    isUseListDirectoryCache(session),\n                    isSkipEmptyFilesEnabled(session),\n                    hdfsContext.getIdentity(),\n                    buildDirectoryContextProperties(session),\n                    session.getRuntimeStats());\n            Iterator<HiveFileInfo> manifestFileInfos = directoryLister.list(fileSystem, table, symlinkDir, partition, namenodeStats, hiveDirectoryContext);\n            return readSymlinkPaths(fileSystem, manifestFileInfos);\n        }\n        catch (IOException e) {\n            throw new PrestoException(HIVE_BAD_DATA, \"Error parsing symlinks from: \" + symlinkDir, e);\n        }\n    }\n\n    private static Properties getPartitionSchema(Table table, Optional<Partition> partition)\n    {\n        return partition.map(value -> getHiveSchema(value, table)).orElseGet(() -> getHiveSchema(table));\n    }\n\n    public static class BucketSplitInfo\n    {\n        private final List<HiveColumnHandle> bucketColumns;\n        private final int tableBucketCount;\n        private final int readBucketCount;\n        private final IntPredicate bucketFilter;\n\n        public static Optional<BucketSplitInfo> createBucketSplitInfo(Optional<HiveBucketHandle> bucketHandle, Optional<HiveBucketing.HiveBucketFilter> bucketFilter)\n        {\n            requireNonNull(bucketHandle, \"bucketHandle is null\");","sourceCodeStart":723,"sourceCodeEnd":759,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/StoragePartitionLoader.java#L723-L759","documentation":"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>'.","triggerScenarios":"getTargetPathsFromSymlink (from targetPaths) calls directoryLister.list/readSymlinkPaths and an IOException occurs reading the symlink manifest directory for the partition.","commonSituations":"Symlink manifest file deleted or moved after partition registration; HDFS permission changes; NameNode connectivity problems; malformed or empty symlink location configured on the partition.","solutions":["Check the symlink target directory exists and is readable (hdfs dfs -ls on the path in the message)","Fix HDFS permissions for the Presto service user on the symlink directory/manifest","Repair the partition: re-register or regenerate the symlink manifest (ALTER TABLE ... REPAIR PARTITIONS or MSCK)","Verify NameNode health/connectivity if the message coincides with network errors"],"exampleFix":"// before: manifest missing\npartitions: location 'hdfs://nn/symlinks/p=1' -> p=1.lst deleted\n// after\nhdfs dfs -put p=1.lst hdfs://nn/symlinks/p=1/\n-- or re-point the partition to a valid manifest location","handlingStrategy":"try-catch","validationCode":"// before querying: verify symlink manifest readable\ntry (FSDataInputStream in = fs.open(new Path(symlinkDir, manifestName))) {\n    String first = in.readLine();\n    if (first == null) throw new IllegalStateException(\"Empty symlink manifest: \" + symlinkDir);\n}","typeGuard":null,"tryCatchPattern":"try {\n    session.execute(query);\n} catch (PrestoException e) {\n    if (HiveErrorCode.HIVE_BAD_DATA.toErrorCode().equals(e.getErrorCode())\n            && e.getMessage().startsWith(\"Error parsing symlinks from:\")) {\n        // check HDFS connectivity/permissions and manifest presence, then retry\n    } else throw e;\n}","preventionTips":["Verify symlink manifest files exist and are readable before querying symlink tables","Grant the Presto user read access on symlink directories","Monitor NameNode availability; transient IO errors surface here","Regenerate manifests after any HDFS layout change"],"tags":["hive","symlink-table","io","hdfs"],"backgroundTag":"symlink-manifest-read-failure","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"}