prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

Unsupported Hive type %s found in partition keys of table %s.%s

What it means

While loading partitions, each partition key's HiveType is checked against the set of types Presto supports. If a partition key uses a type Presto cannot map (e.g. a UNIONTYPE, INTERVAL, or another exotic Hive type), the connector refuses with NOT_SUPPORTED rather than misrepresenting the data.

Source

Thrown at presto-hive/src/main/java/com/facebook/presto/hive/PartitionLoader.java:60

    public List<HivePartitionKey> getPartitionKeys(Table table, Optional<Partition> partition, String partitionName)
    {
        if (!partition.isPresent()) {
            return ImmutableList.of();
        }
        ImmutableList.Builder<HivePartitionKey> partitionKeys = ImmutableList.builder();
        // partition information provided by Hive Metastore could be out of order
        List<Column> keys = table.getPartitionColumns();
        List<HiveColumnHandle> partitionColumns = getPartitionKeyColumnHandles(table);
        List<String> partitionColumnNames = partitionColumns.stream()
                .map(HiveColumnHandle::getName)
                .collect(Collectors.toList());
        List<String> values = extractPartitionValues(partitionName, Optional.of(partitionColumnNames));
        checkCondition(keys.size() == values.size(), HIVE_INVALID_METADATA, "Expected %s partition key values, but got %s", keys.size(), values.size());
        for (int i = 0; i < keys.size(); i++) {
            String name = keys.get(i).getName();
            HiveType hiveType = keys.get(i).getType();
            if (!hiveType.isSupportedType()) {
                throw new PrestoException(NOT_SUPPORTED, format("Unsupported Hive type %s found in partition keys of table %s.%s", hiveType, table.getDatabaseName(), table.getTableName()));
            }
            String value = values.get(i);
            checkCondition(value != null, HIVE_INVALID_PARTITION_VALUE, "partition key value cannot be null for field: %s", name);
            partitionKeys.add(new HivePartitionKey(name, HIVE_DEFAULT_DYNAMIC_PARTITION.equals(value) ? Optional.empty() : Optional.of(value)));
        }
        return partitionKeys.build();
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Recreate the table with partition keys using supported types (STRING is typical for partition keys).
  2. If the underlying values are fine, cast/normalize the partition column type in Hive before querying through Presto.
  3. Exclude that table from Presto or use a view that avoids the unsupported partition key if the engine permits.
  4. Check hive.type/unsupported-type handling session properties only as a stopgap where the connector offers one.

Example fix

-- before
CREATE TABLE t (v BIGINT) PARTITIONED BY (p UNIONTYPE<int,string>);
-- after
CREATE TABLE t (v BIGINT) PARTITIONED BY (p STRING);
Defensive patterns

Strategy: validation

Validate before calling

// Before querying, inspect partition key types:
SELECT * FROM system.jdbc.columns WHERE table_name = 'my_table';
-- or check via Hive metastore: reject tables whose partition keys are UNIONTYPE, INTERVAL, etc.

Try / catch

try {
    connector.listPartitionNames(schema, table, bindings);
} catch (PrestoException e) {
    if (e.getErrorCode().getCode() == StandardErrorCode.NOT_SUPPORTED.toErrorCode().getCode()) {
        // fall back to direct Hive access or fix the table schema
    }
}

Prevention

When it happens

Trigger: Querying or listing partitions of a Hive table whose partition keys include a Hive type not in Presto's supported set (e.g. UNIONTYPE, NULL-type, or connector-unsupported types like INTERVAL).

Common situations: Tables created by other Hive-compatible engines using exotic partition-key types; legacy tables with typed partition keys never validated by Presto; migrations from Hive distributions that permit more partition-key types than Presto.

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/95b644fb6bd6cbb5. Report an issue: GitHub.