{"record":{"id":"d9b313e3e57e12f0","repo":"prestodb/presto","slug":"hive-unsupported-format-d9b313","errorCode":"HIVE_UNSUPPORTED_FORMAT","errorMessage":"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.","messagePattern":"Partial aggregation pushdown is not supported when footer stats are unreliable\\. Table (.+?) has file (.+?) with unreliable footer stats\\. Set session property \\[catalog-name\\]\\.pushdown_partial_aggregations_into_scan=false and execute query again\\.","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HivePageSourceProvider.java","lineNumber":179,"sourceCode":"\n        Optional<EncryptionInformation> encryptionInformation = hiveSplit.getEncryptionInformation();\n        CacheQuota cacheQuota = generateCacheQuota(hiveSplit);\n        HiveFileContext fileContext = new HiveFileContext(\n                splitContext.isCacheable(),\n                cacheQuota,\n                hiveSplit.getFileSplit().getExtraFileInfo().map(BinaryExtraHiveFileInfo::new),\n                OptionalLong.of(hiveSplit.getFileSplit().getFileSize()),\n                OptionalLong.of(hiveSplit.getFileSplit().getStart()),\n                OptionalLong.of(hiveSplit.getFileSplit().getLength()),\n                hiveSplit.getFileSplit().getFileModifiedTime(),\n                HiveSessionProperties.isVerboseRuntimeStatsEnabled(session),\n                runtimeStats);\n\n        if (columns.stream().anyMatch(columnHandle -> ((HiveColumnHandle) columnHandle).getColumnType().equals(AGGREGATED))) {\n            checkArgument(columns.stream().allMatch(columnHandle -> ((HiveColumnHandle) columnHandle).getColumnType().equals(AGGREGATED)), \"Not all columns are of 'AGGREGATED' type\");\n\n            if (hiveLayout.isFooterStatsUnreliable()) {\n                throw new PrestoException(HIVE_UNSUPPORTED_FORMAT, format(\"Partial aggregation pushdown is not supported when footer stats are unreliable. \" +\n                                \"Table %s has file %s with unreliable footer stats. \" +\n                                \"Set session property [catalog-name].pushdown_partial_aggregations_into_scan=false and execute query again.\",\n                        hiveLayout.getSchemaTableName(),\n                        hiveSplit.getFileSplit().getPath()));\n            }\n\n            return createAggregatedPageSource(aggregatedPageSourceFactories, configuration, session, hiveSplit, hiveLayout, selectedColumns, fileContext, encryptionInformation);\n        }\n        if (hiveLayout.isPushdownFilterEnabled()) {\n            Optional<ConnectorPageSource> selectivePageSource = createSelectivePageSource(\n                    selectivePageSourceFactories,\n                    configuration,\n                    session,\n                    hiveSplit,\n                    hiveLayout,\n                    selectedColumns,\n                    hiveStorageTimeZone,\n                    typeManager,","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HivePageSourceProvider.java#L161-L197","documentation":"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.","triggerScenarios":"createPageSource called with columns containing AGGREGATED type handles while hiveLayout.isFooterStatsUnreliable() is true for the split's file.","commonSituations":"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.","solutions":["Set session property <catalog-name>.pushdown_partial_aggregations_into_scan=false and rerun the query.","Rewrite/compact the offending files so footers carry reliable stats.","Exclude the unreliable files/partition from the query or repair them with an INSERT overwrite.","Upgrade the writer version that produced the files, then recompute stats."],"exampleFix":"-- before\nSELECT sum(x) FROM unreliable_stats_table;\n-- after\nSET SESSION hive.pushdown_partial_aggregations_into_scan = false;\nSELECT sum(x) FROM unreliable_stats_table;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (PrestoException e) {\n    if (\"HIVE_UNSUPPORTED_FORMAT\".equals(e.getErrorCode().getName())\n            && e.getMessage().contains(\"unreliable footer stats\")) {\n        // set pushdown_partial_aggregations_into_scan=false and rerun\n    }\n}","preventionTips":["On tables with mixed-age files, preemptively disable pushdown_partial_aggregations_into_scan.","Compact/rewrite old files with a modern writer to produce reliable footers.","The error message names the offending file — inspect and repair that file's stats.","Keep writer versions uniform across partitions feeding aggregate queries."],"tags":["hive","aggregation-pushdown","footer-stats","unsupported-format"],"backgroundTag":"aggregation-pushdown-unsupported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}