prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

e.getMessage()

What it means

Map equality (map = map via genericEqual) performs key lookup with SingleMapBlock.seekKey; when the key type does not support native comparison, a NotSupportedException is thrown and re-wrapped as a PrestoException with NOT_SUPPORTED.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/scalar/MapGenericEquality.java:64

    {
        if (leftBlock.getPositionCount() != rightBlock.getPositionCount()) {
            return false;
        }

        SingleMapBlock leftSingleMapLeftBlock = (SingleMapBlock) leftBlock;
        SingleMapBlock rightSingleMapBlock = (SingleMapBlock) rightBlock;

        boolean indeterminate = false;
        for (int position = 0; position < leftSingleMapLeftBlock.getPositionCount(); position += 2) {
            Object key = readNativeValue(keyType, leftBlock, position);
            int leftPosition = position + 1;

            int rightPosition;
            try {
                rightPosition = rightSingleMapBlock.seekKey(key, keyNativeHashCode, keyBlockNativeEquals, keyBlockHashCode);
            }
            catch (NotSupportedException e) {
                throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);
            }

            if (rightPosition == -1) {
                return false;
            }

            try {
                Boolean result = predicate.equals(leftPosition, rightPosition);
                if (result == null) {
                    indeterminate = true;
                }
                else if (!result) {
                    return false;
                }
            }
            catch (Throwable t) {
                throw internalError(t);
            }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use maps with primitive key types.
  2. Normalize comparisons: compare map_keys and map_values arrays instead of whole-map equality when keys are complex.
  3. Cast keys to simpler types before building maps.
  4. Upgrade to a Presto version supporting the key type in comparisons.

Example fix

// before
SELECT * FROM t WHERE m1 = m2; -- map(row(...), bigint)
// after
SELECT * FROM t WHERE map_keys(m1) = map_keys(m2) AND map_values(m1) = map_values(m2); -- with simple keys
Defensive patterns

Strategy: try-catch

Validate before calling

SELECT typeof(m1) FROM t; -- ensure key type is primitive before equality comparison

Try / catch

try {
    equal = genericEqual(left, right);
} catch (PrestoException e) {
    if (e.getErrorCode().getName().equals("NOT_SUPPORTED")) {
        // compare keys/values arrays instead
    }
}

Prevention

When it happens

Trigger: Comparing two maps with =, != or similar generic equality functions where the key type lacks native hash/equals (complex key types).

Common situations: Equality predicates or GROUP BY/DISTINCT over map columns with complex keys after schema evolution.

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/78dc61e2cb99da97. Report an issue: GitHub.