prestodb/presto · error · PrestoException

HIVE_UNKNOWN_ERROR

HIVE_UNKNOWN_ERROR

Error message

%s is not supported

What it means

generateCacheQuota maps the configured hive.cache quota-target-type (DATABASE, TABLE, PARTITION) to a CacheQuota. Any other quota enum value reaches the default branch, which throws HIVE_UNKNOWN_ERROR saying the quota value is not supported.

Source

Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HivePageSourceProvider.java:308

                        hiveLayout.getSchemaTableName(),
                        hiveSplit.getStorage().getStorageFormat().getSerDe()));
    }

    @VisibleForTesting
    protected static CacheQuota generateCacheQuota(HiveSplit hiveSplit)
    {
        Optional<DataSize> quota = hiveSplit.getCacheQuotaRequirement().getQuota();
        switch (hiveSplit.getCacheQuotaRequirement().getCacheQuotaScope()) {
            case GLOBAL:
                return new CacheQuota(".", quota);
            case SCHEMA:
                return new CacheQuota(hiveSplit.getDatabase(), quota);
            case TABLE:
                return new CacheQuota(hiveSplit.getDatabase() + "." + hiveSplit.getTable(), quota);
            case PARTITION:
                return new CacheQuota(hiveSplit.getDatabase() + "." + hiveSplit.getTable() + "." + hiveSplit.getPartitionName(), quota);
            default:
                throw new PrestoException(HIVE_UNKNOWN_ERROR, format("%s is not supported", quota));
        }
    }

    private static Optional<ConnectorPageSource> createSelectivePageSource(
            Set<HiveSelectivePageSourceFactory> selectivePageSourceFactories,
            Configuration configuration,
            ConnectorSession session,
            HiveSplit split,
            HiveTableLayoutHandle layout,
            List<HiveColumnHandle> selectedColumns,
            DateTimeZone hiveStorageTimeZone,
            TypeManager typeManager,
            LoadingCache<RowExpressionCacheKey, RowExpression> rowExpressionCache,
            SplitContext splitContext,
            HiveFileContext fileContext,
            Optional<EncryptionInformation> encryptionInformation)
    {
        Set<HiveColumnHandle> interimColumns = ImmutableSet.<HiveColumnHandle>builder()

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Set the cache quota target type to DATABASE, TABLE, or PARTITION.
  2. Upgrade or align the Presto version so connector code and enum values match.
  3. Disable the cache quota configuration if not needed.
  4. File/fix the connector to handle the new enum value in generateCacheQuota.

Example fix

// before
default: throw new PrestoException(HIVE_UNKNOWN_ERROR, format("%s is not supported", quota));
// after
default: throw new PrestoException(HIVE_UNKNOWN_ERROR, format("Cache quota target %s is not supported", quota));
// or handle new cases before default
case SCHEMA: return new CacheQuota(hiveSplit.getDatabase(), quota);
Defensive patterns

Strategy: validation

Validate before calling

// allowed cache quota targets
Set<String> valid = Set.of("DATABASE", "TABLE", "PARTITION");
if (!valid.contains(quotaTargetType)) throw new IllegalArgumentException("unsupported quota target: " + quotaTargetType);

Try / catch

catch (PrestoException e) {
    if ("HIVE_UNKNOWN_ERROR".equals(e.getErrorCode().getName())
            && e.getMessage().contains("is not supported")) {
        // fix cache quota target-type config to DATABASE/TABLE/PARTITION
    }
}

Prevention

When it happens

Trigger: cacheQuota -> generateCacheQuota invoked with a CacheQuota whose quota/type falls outside the DATABASE/TABLE/PARTITION cases — typically a newly added enum constant or misconfigured quota type.

Common situations: Running a Presto version where a new quota-target type exists but generateCacheQuota wasn't updated, or a config/session value that deserialized into an unexpected quota type.

Related errors


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