prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

Unsupported type [%s] for partition: %s

What it means

Partition (and bucket) column types must be ones the connector can convert from their string-encoded partition values — decimals, numeric/primitive types accepted by isValidPartitionType. verifyPartitionTypeSupported throws NOT_SUPPORTED when a partition key's type is outside that set, because parsePartitionValue cannot decode it.

Source

Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveUtil.java:611

    {
        try {
            configuration = copy(configuration); // Some SerDes (e.g. Avro) modify passed configuration
            ((AbstractSerDe) deserializer).initialize(configuration, schema, null);
        }
        catch (SerDeException | RuntimeException e) {
            throw new RuntimeException("error initializing deserializer: " + deserializer.getClass().getName(), e);
        }
    }

    public static boolean isHiveNull(byte[] bytes)
    {
        return bytes.length == 2 && bytes[0] == '\\' && bytes[1] == 'N';
    }

    public static void verifyPartitionTypeSupported(String partitionName, Type type)
    {
        if (!isValidPartitionType(type)) {
            throw new PrestoException(NOT_SUPPORTED, format("Unsupported type [%s] for partition: %s", type, partitionName));
        }
    }

    private static boolean isValidPartitionType(Type type)
    {
        return type instanceof DecimalType ||
                BOOLEAN.equals(type) ||
                TINYINT.equals(type) ||
                SMALLINT.equals(type) ||
                INTEGER.equals(type) ||
                BIGINT.equals(type) ||
                REAL.equals(type) ||
                DOUBLE.equals(type) ||
                DATE.equals(type) ||
                TIMESTAMP.equals(type) ||
                isVarcharType(type) ||
                isCharType(type) ||
                isEnumType(type) ||

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Recreate the table partitioned on a supported primitive type (string, bigint, int, date, varchar, decimal, etc.)
  2. CAST the partition column to a supported type at the source and repartition the data
  3. Skip reading those partitions / filter them out if only some partitions use unsupported keys

Example fix

-- before
CREATE TABLE t (...) PARTITION BY LIST (p complex_type) ...
-- after
CREATE TABLE t (...) PARTITION BY LIST (p varchar) ... -- repartition with string-encoded key
Defensive patterns

Strategy: validation

Validate before calling

Set<String> supported = Set.of("boolean","bigint","integer","smallint","tinyint","real","double","decimal","varchar","date","timestamp","interval year to month","interval day to second");
if (!supported.contains(typeName.toLowerCase())) throw new IllegalArgumentException("unsupported partition type: " + typeName);

Type guard

boolean isValidPartitionType(Type type) {
    return type instanceof DecimalType || type instanceof BigintType || type instanceof IntegerType
        || type instanceof SmallintType || type instanceof TinyintType || type instanceof DoubleType
        || type instanceof RealType || type instanceof VarcharType || type instanceof DateType
        || type instanceof TimestampType;
}

Try / catch

try { listPartitions(table); } catch (PrestoException e) { if (e.getErrorCode().getName().equals("NOT_SUPPORTED")) { /* repartition on a supported primitive or exclude table */ } else throw e; }

Prevention

When it happens

Trigger: Querying or listing partitions of a table whose partition key type is exotic/custom (e.g. complex types, unsupported date/time variants) — checked during partition value parsing.

Common situations: Hive tables partitioned on types Presto's Hive connector doesn't map (legacy UNIONTYPE/struct partition keys, unusual custom object types); tables created by external tools with non-standard partition schemas.

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/39fb52be2ff70804. Report an issue: GitHub.