{"record":{"id":"6535309698bb99ff","repo":"prestodb/presto","slug":"no-min-max-found-for-orc-file-set-session-propert","errorCode":null,"errorMessage":"No min/max found for orc file. Set session property hive.pushdown_partial_aggregations_into_scan=false and execute query again","messagePattern":"No min/max found for orc file\\. Set session property hive\\.pushdown_partial_aggregations_into_scan=false and execute query again","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/orc/AggregatedOrcPageSource.java","lineNumber":148,"sourceCode":"    }\n\n    private void writeMinMax(int columnIndex, Type type, HiveType hiveType, BlockBuilder blockBuilder, boolean isMin)\n    {\n        ColumnStatistics columnStatistics = footer.getFileStats().get(columnIndex + 1);\n        OrcType orcType = footer.getTypes().get(columnIndex + 1);\n\n        if (type instanceof FixedWidthType) {\n            completedBytes += ((FixedWidthType) type).getFixedSize();\n        }\n\n        String orcNoMinMaxMessage = \"No min/max found for orc file. Set session property hive.pushdown_partial_aggregations_into_scan=false and execute query again\";\n        switch (orcType.getOrcTypeKind()) {\n            case SHORT:\n            case INT:\n            case LONG: {\n                Long value = isMin ? columnStatistics.getIntegerStatistics().getMin() : columnStatistics.getIntegerStatistics().getMax();\n                if (value == null) {\n                    throw new UnsupportedOperationException(orcNoMinMaxMessage);\n                }\n                else {\n                    blockBuilder.writeLong(value);\n                }\n                break;\n            }\n\n            case TIMESTAMP:\n            case DATE: {\n                Integer value = isMin ? columnStatistics.getDateStatistics().getMin() : columnStatistics.getDateStatistics().getMax();\n                if (value == null) {\n                    throw new UnsupportedOperationException(orcNoMinMaxMessage);\n                }\n                else {\n                    blockBuilder.writeLong(Long.valueOf(value));\n                }\n                break;\n            }","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/orc/AggregatedOrcPageSource.java#L130-L166","documentation":"writeMinMax cannot find min/max statistics for the requested column in the ORC file footer, so partial-aggregation pushdown into the scan cannot proceed; it advises disabling hive.pushdown_partial_aggregations_into_scan and rerunning.","triggerScenarios":"Thrown at presto-hive/src/main/java/com/facebook/presto/hive/orc/AggregatedOrcPageSource.java:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set hive.pushdown_partial_aggregations_into_scan=false and rerun the query","Write ORC files with column statistics (min/max) populated"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}