prestodb/presto · error · PrestoException

HIVE_UNSUPPORTED_FORMAT

HIVE_UNSUPPORTED_FORMAT

Error message

Partial aggregation pushdown is not supported when footer stats are unreliable. Table %s has file %s with unreliable footer stats. Set session property [catalog-name].pushdown_partial_aggregations_into_scan=false and execute query again.

What it means

HivePageSourceProvider.createPageSource supports partial aggregation pushdown into the scan when all requested columns are AGGREGATED column handles. If the layout reports isFooterStatsUnreliable() (file footers can't be trusted for stats), the provider refuses to push down and throws HIVE_UNSUPPORTED_FORMAT with instructions to disable the feature.

Source

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

        Optional<EncryptionInformation> encryptionInformation = hiveSplit.getEncryptionInformation();
        CacheQuota cacheQuota = generateCacheQuota(hiveSplit);
        HiveFileContext fileContext = new HiveFileContext(
                splitContext.isCacheable(),
                cacheQuota,
                hiveSplit.getFileSplit().getExtraFileInfo().map(BinaryExtraHiveFileInfo::new),
                OptionalLong.of(hiveSplit.getFileSplit().getFileSize()),
                OptionalLong.of(hiveSplit.getFileSplit().getStart()),
                OptionalLong.of(hiveSplit.getFileSplit().getLength()),
                hiveSplit.getFileSplit().getFileModifiedTime(),
                HiveSessionProperties.isVerboseRuntimeStatsEnabled(session),
                runtimeStats);

        if (columns.stream().anyMatch(columnHandle -> ((HiveColumnHandle) columnHandle).getColumnType().equals(AGGREGATED))) {
            checkArgument(columns.stream().allMatch(columnHandle -> ((HiveColumnHandle) columnHandle).getColumnType().equals(AGGREGATED)), "Not all columns are of 'AGGREGATED' type");

            if (hiveLayout.isFooterStatsUnreliable()) {
                throw new PrestoException(HIVE_UNSUPPORTED_FORMAT, format("Partial aggregation pushdown is not supported when footer stats are unreliable. " +
                                "Table %s has file %s with unreliable footer stats. " +
                                "Set session property [catalog-name].pushdown_partial_aggregations_into_scan=false and execute query again.",
                        hiveLayout.getSchemaTableName(),
                        hiveSplit.getFileSplit().getPath()));
            }

            return createAggregatedPageSource(aggregatedPageSourceFactories, configuration, session, hiveSplit, hiveLayout, selectedColumns, fileContext, encryptionInformation);
        }
        if (hiveLayout.isPushdownFilterEnabled()) {
            Optional<ConnectorPageSource> selectivePageSource = createSelectivePageSource(
                    selectivePageSourceFactories,
                    configuration,
                    session,
                    hiveSplit,
                    hiveLayout,
                    selectedColumns,
                    hiveStorageTimeZone,
                    typeManager,

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Set session property <catalog-name>.pushdown_partial_aggregations_into_scan=false and rerun the query.
  2. Rewrite/compact the offending files so footers carry reliable stats.
  3. Exclude the unreliable files/partition from the query or repair them with an INSERT overwrite.
  4. Upgrade the writer version that produced the files, then recompute stats.

Example fix

-- before
SELECT sum(x) FROM unreliable_stats_table;
-- after
SET SESSION hive.pushdown_partial_aggregations_into_scan = false;
SELECT sum(x) FROM unreliable_stats_table;
Defensive patterns

Strategy: try-catch

Try / catch

catch (PrestoException e) {
    if ("HIVE_UNSUPPORTED_FORMAT".equals(e.getErrorCode().getName())
            && e.getMessage().contains("unreliable footer stats")) {
        // set pushdown_partial_aggregations_into_scan=false and rerun
    }
}

Prevention

When it happens

Trigger: createPageSource called with columns containing AGGREGATED type handles while hiveLayout.isFooterStatsUnreliable() is true for the split's file.

Common situations: Querying a table whose files were written by writers that don't produce trustworthy footer stats (older writers, certain formats/compacted files), partial-aggregation-pushdown enabled by default while scanning mixed-quality files.

Related errors


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