{"record":{"id":"1c7b9fd5de63504d","repo":"prestodb/presto","slug":"not-supported-1c7b9f","errorCode":"NOT_SUPPORTED","errorMessage":"e.getMessage()","messagePattern":"e\\.getMessage\\(\\)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/operator/scalar/MapConstructor.java","lineNumber":193,"sourceCode":"                        throw new PrestoException(INVALID_FUNCTION_ARGUMENT, \"map key cannot be indeterminate: \" + mapType.getKeyType().getObjectValue(properties, keyBlock, i));\n                    }\n                }\n                catch (Throwable t) {\n                    throw internalError(t);\n                }\n            }\n\n            keyType.appendTo(keyBlock, i, blockBuilder);\n            valueType.appendTo(valueBlock, i, blockBuilder);\n        }\n        try {\n            mapBlockBuilder.closeEntryStrict(keyBlockEqual, keyBlockHashCode);\n        }\n        catch (DuplicateMapKeyException e) {\n            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, e.getDetailedMessage(mapType.getKeyType(), properties), e);\n        }\n        catch (NotSupportedException e) {\n            throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);\n        }\n\n        return mapType.getObject(mapBlockBuilder, mapBlockBuilder.getPositionCount() - 1);\n    }\n}\n","sourceCodeStart":175,"sourceCodeEnd":199,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/operator/scalar/MapConstructor.java#L175-L199","documentation":"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.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/scalar/MapConstructor.java:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Deduplicate keys before building the map, e.g. with map_from_entries over a deduped array","Keep only one entry per key using aggregation (max_by / arbitrary) before constructing the map","If duplicates are meaningful, use an array of rows instead of a map"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}