prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

%s

What it means

ValueStore.addAndGetPosition wraps NotSupportedException (raised by the underlying OpenBigArray/HashTable probing code when an operation is unsupported) into a PrestoException with code NOT_SUPPORTED. This means the value store hit a capability its implementation does not provide, e.g. a store size or key configuration outside the supported range.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/aggregation/histogram/ValueStore.java:109

                    valuePointer = values.getPositionCount();
                    valueHashes.set(valuePointer, (int) valueHash);
                    type.appendTo(block, position, values);
                    buckets.set(bucketId, valuePointer);

                    return valuePointer;
                }
                else if (type.equalTo(block, position, values, valuePointer)) {
                    // value at position
                    return valuePointer;
                }
                else {
                    int probe = nextProbe(probeCount);
                    bucketId = nextBucketId(originalBucketId, mask, probe);
                    probeCount++;
                }
            }
            catch (NotSupportedException e) {
                throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);
            }
        }
    }

    private int getBucketId(long valueHash, int mask)
    {
        return (int) (valueHash & mask);
    }

    @VisibleForTesting
    void rehash()
    {
        ++rehashCount;

        long newBucketCountLong = bucketCount * 2L;

        if (newBucketCountLong > Integer.MAX_VALUE) {
            throw new PrestoException(GENERIC_INSUFFICIENT_RESOURCES, "Size of hash table cannot exceed " + Integer.MAX_VALUE + " entries (" + newBucketCountLong + ")");

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Reduce input cardinality (pre-aggregate, bucket, or sample) so the value store stays within supported limits.
  2. Check which inner operation throws NotSupportedException (inspect the cause chain) and align usage with its documented limits.
  3. Use a different aggregation (e.g. approx_distinct, sketches) if exact per-value storage is required at this scale.
Defensive patterns

Strategy: try-catch

Try / catch

-- Wrap the risky aggregation in a fallback
SELECT COALESCE((SELECT histogram(val) FROM t WHERE <bounded>), MAP()) AS h;

Prevention

When it happens

Trigger: Calling addAndGetPosition on ValueStore during histogram/min-max-n aggregation when the internal OpenBigHashTable raises NotSupportedException while probing/inserting a value hash into the bucket array.

Common situations: Aggregating extremely large cardinality values through histogram-type aggregations; configurations where the internal hash table cannot grow or allocate the needed capacity.

Understand the failure class

Background: Presto NOT_SUPPORTED error: what "not supported" means and how to fix it — this error's family across 3 libraries.

Related errors


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