prestodb/presto · error · PrestoException

NOT_SUPPORTED

NOT_SUPPORTED

Error message

e.getMessage()

What it means

Duplicate-key error from createMap: closing the map entry detected two equal non-null keys (DuplicateMapKeyException) and the underlying exception's message is re-thrown wrapped in INVALID_FUNCTION_ARGUMENT. The offending input is the key/value argument pair passed to map_constructor or the map literal.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/scalar/MapConstructor.java:193

                        throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "map key cannot be indeterminate: " + mapType.getKeyType().getObjectValue(properties, keyBlock, i));
                    }
                }
                catch (Throwable t) {
                    throw internalError(t);
                }
            }

            keyType.appendTo(keyBlock, i, blockBuilder);
            valueType.appendTo(valueBlock, i, blockBuilder);
        }
        try {
            mapBlockBuilder.closeEntryStrict(keyBlockEqual, keyBlockHashCode);
        }
        catch (DuplicateMapKeyException e) {
            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, e.getDetailedMessage(mapType.getKeyType(), properties), e);
        }
        catch (NotSupportedException e) {
            throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);
        }

        return mapType.getObject(mapBlockBuilder, mapBlockBuilder.getPositionCount() - 1);
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Deduplicate keys before building the map, e.g. with map_from_entries over a deduped array
  2. Keep only one entry per key using aggregation (max_by / arbitrary) before constructing the map
  3. If duplicates are meaningful, use an array of rows instead of a map
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/scalar/MapConstructor.java:193 when the library encounters an invalid state.

Common situations: See trigger scenarios.

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.


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