prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

Bucketed table in SymlinkTextInputFormat is not yet supported

What it means

SymlinkTextInputFormat stores a symlink file listing target data files instead of a plain directory layout. Presto's symlink handling path cannot distribute rows into buckets, so when a bucketed table uses this input format it refuses up front with NOT_SUPPORTED. This is a deliberate capability guard, not a data corruption condition.

Source

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

    private ListenableFuture<?> handleSymlinkTextInputFormat(
            ExtendedFileSystem fs,
            Path path,
            InputFormat<?, ?> inputFormat,
            boolean s3SelectPushdownEnabled,
            Storage storage,
            List<HivePartitionKey> partitionKeys,
            String partitionName,
            int partitionDataColumnCount,
            boolean stopped,
            HivePartitionMetadata partition,
            HiveSplitSource hiveSplitSource,
            Configuration configuration,
            boolean splittable)
            throws IOException
    {
        if (tableBucketInfo.isPresent()) {
            throw new PrestoException(NOT_SUPPORTED, "Bucketed table in SymlinkTextInputFormat is not yet supported");
        }

        List<Path> targetPaths = getTargetPathsFromSymlink(fs, path, partition.getPartition());

        if (isSymlinkOptimizedReaderEnabled(session)) {
            Map<Path, List<Path>> parentToTargets = targetPaths.stream().collect(Collectors.groupingBy(Path::getParent));

            InputFormat<?, ?> targetInputFormat = getInputFormat(
                    configuration,
                    storage.getStorageFormat().getInputFormat(),
                    storage.getStorageFormat().getSerDe(),
                    true);

            HiveDirectoryContext hiveDirectoryContext = new HiveDirectoryContext(
                    IGNORED,
                    isUseListDirectoryCache(session),
                    isSkipEmptyFilesEnabled(session),
                    hdfsContext.getIdentity(),

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Rewrite the table/partitions to a regular input format (e.g. skip SymlinkTextInputFormat and store data files directly in the partition directory)
  2. Remove the CLUSTERED BY/BUCKETS declaration (ALTER TABLE ... UNBUCKET or recreate the table unbucketed) if bucketing is not required
  3. Write the data without bucketing using an engine that supports it, then query unbucketed
  4. Split the dataset: keep bucketed partitions in a normal input-format table and symlink layouts in an unbucketed one

Example fix

-- before
CREATE TABLE t (...) CLUSTERED BY (k) INTO 32 BUCKETS STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat';
-- after
CREATE TABLE t (...) STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat'; -- drop bucketing, or use a normal input format with buckets
Defensive patterns

Strategy: validation

Validate before calling

-- detect the condition before querying
SHOW CREATE TABLE my_table; -- look for CLUSTERED BY ... BUCKETS plus SymlinkTextInputFormat
-- or in code:
boolean unsupported = table.getStorage().getStorageFormat().getInputFormat().contains("SymlinkTextInputFormat")
    && table.getBucketProperty().isPresent();

Try / catch

try {
    connector.splitManager().getSplits(...);
} catch (PrestoException e) {
    if (NOT_SUPPORTED.equals(e.getErrorCode().getName())) {
        // fall back to an unbucketed copy of the table
        return queryUnbucketedCopy();
    }
    throw e;
}

Prevention

When it happens

Trigger: loadPartition() dispatches to handleSymlinkTextInputFormat() and the resolved tableBucketInfo is present — i.e. a Hive table declared with CLUSTERED BY ... INTO n BUCKETS whose partition uses SymlinkTextInputFormat.

Common situations: Tables created by engines (e.g. older Hive or Spark setups) that emit symlink manifest files for bucketed partitions; copying a bucketed table's metadata into a symlink-based layout; storage format set to SymlinkTextInputFormat on a bucketed table.

Understand the failure class

Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.

Related errors


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