prestodb/presto · error · UnsupportedOperationException

No min/max found for orc file. Set session property hive.pus

Error message

No min/max found for orc file. Set session property hive.pushdown_partial_aggregations_into_scan=false and execute query again

What it means

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.

Source

Thrown at presto-hive/src/main/java/com/facebook/presto/hive/orc/AggregatedOrcPageSource.java:148

    }

    private void writeMinMax(int columnIndex, Type type, HiveType hiveType, BlockBuilder blockBuilder, boolean isMin)
    {
        ColumnStatistics columnStatistics = footer.getFileStats().get(columnIndex + 1);
        OrcType orcType = footer.getTypes().get(columnIndex + 1);

        if (type instanceof FixedWidthType) {
            completedBytes += ((FixedWidthType) type).getFixedSize();
        }

        String orcNoMinMaxMessage = "No min/max found for orc file. Set session property hive.pushdown_partial_aggregations_into_scan=false and execute query again";
        switch (orcType.getOrcTypeKind()) {
            case SHORT:
            case INT:
            case LONG: {
                Long value = isMin ? columnStatistics.getIntegerStatistics().getMin() : columnStatistics.getIntegerStatistics().getMax();
                if (value == null) {
                    throw new UnsupportedOperationException(orcNoMinMaxMessage);
                }
                else {
                    blockBuilder.writeLong(value);
                }
                break;
            }

            case TIMESTAMP:
            case DATE: {
                Integer value = isMin ? columnStatistics.getDateStatistics().getMin() : columnStatistics.getDateStatistics().getMax();
                if (value == null) {
                    throw new UnsupportedOperationException(orcNoMinMaxMessage);
                }
                else {
                    blockBuilder.writeLong(Long.valueOf(value));
                }
                break;
            }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Set hive.pushdown_partial_aggregations_into_scan=false and rerun the query
  2. Write ORC files with column statistics (min/max) populated
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at presto-hive/src/main/java/com/facebook/presto/hive/orc/AggregatedOrcPageSource.java:148 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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