prestodb/presto · error · UnsupportedOperationException

is not supported

Error message

 is not supported

What it means

Aggregation pushdown dispatch on ORC metadata: the pushed-down aggregation function is neither count, min, nor max (the only ones satisfiable from column statistics), so the aggregated page source cannot answer it.

Source

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

            FunctionHandle functionHandle = aggregation.getFunctionHandle();

            if (functionResolution.isCountFunction(functionHandle)) {
                if (aggregation.getArguments().isEmpty()) {
                    blockBuilder = blockBuilder.writeLong(footer.getNumberOfRows());
                }
                else {
                    writeNonNullCount(columnIndex, blockBuilder);
                }
                completedBytes += INTEGER.getFixedSize();
            }
            else if (functionResolution.isMaxFunction(functionHandle)) {
                writeMinMax(columnIndex, type, columnHandle.getHiveType(), blockBuilder, false);
            }
            else if (functionResolution.isMinFunction(functionHandle)) {
                writeMinMax(columnIndex, type, columnHandle.getHiveType(), blockBuilder, true);
            }
            else {
                throw new UnsupportedOperationException(aggregation.getFunctionHandle().toString() + " is not supported");
            }
            blocks[fieldId] = blockBuilder.build();
        }

        completed = true;
        readTimeNanos += System.nanoTime() - start;
        return new Page(batchSize, blocks);
    }

    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();
        }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Disable partial-aggregation pushdown for this query (hive.pushdown_partial_aggregations_into_scan=false)
  2. Restrict pushed-down aggregations to count/min/max
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at presto-hive/src/main/java/com/facebook/presto/hive/orc/AggregatedOrcPageSource.java:122 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/ddec3c6aac0580dc. Report an issue: GitHub.