{"record":{"id":"78dc61e2cb99da97","repo":"prestodb/presto","slug":"not-supported-78dc61","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/MapGenericEquality.java","lineNumber":64,"sourceCode":"    {\n        if (leftBlock.getPositionCount() != rightBlock.getPositionCount()) {\n            return false;\n        }\n\n        SingleMapBlock leftSingleMapLeftBlock = (SingleMapBlock) leftBlock;\n        SingleMapBlock rightSingleMapBlock = (SingleMapBlock) rightBlock;\n\n        boolean indeterminate = false;\n        for (int position = 0; position < leftSingleMapLeftBlock.getPositionCount(); position += 2) {\n            Object key = readNativeValue(keyType, leftBlock, position);\n            int leftPosition = position + 1;\n\n            int rightPosition;\n            try {\n                rightPosition = rightSingleMapBlock.seekKey(key, keyNativeHashCode, keyBlockNativeEquals, keyBlockHashCode);\n            }\n            catch (NotSupportedException e) {\n                throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);\n            }\n\n            if (rightPosition == -1) {\n                return false;\n            }\n\n            try {\n                Boolean result = predicate.equals(leftPosition, rightPosition);\n                if (result == null) {\n                    indeterminate = true;\n                }\n                else if (!result) {\n                    return false;\n                }\n            }\n            catch (Throwable t) {\n                throw internalError(t);\n            }","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/operator/scalar/MapGenericEquality.java#L46-L82","documentation":"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.","triggerScenarios":"Comparing two maps with =, != or similar generic equality functions where the key type lacks native hash/equals (complex key types).","commonSituations":"Equality predicates or GROUP BY/DISTINCT over map columns with complex keys after schema evolution.","solutions":["Use maps with primitive key types.","Normalize comparisons: compare map_keys and map_values arrays instead of whole-map equality when keys are complex.","Cast keys to simpler types before building maps.","Upgrade to a Presto version supporting the key type in comparisons."],"exampleFix":"// before\nSELECT * FROM t WHERE m1 = m2; -- map(row(...), bigint)\n// after\nSELECT * FROM t WHERE map_keys(m1) = map_keys(m2) AND map_values(m1) = map_values(m2); -- with simple keys","handlingStrategy":"try-catch","validationCode":"SELECT typeof(m1) FROM t; -- ensure key type is primitive before equality comparison","typeGuard":null,"tryCatchPattern":"try {\n    equal = genericEqual(left, right);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"NOT_SUPPORTED\")) {\n        // compare keys/values arrays instead\n    }\n}","preventionTips":["Avoid map columns with complex keys in comparison contexts","Use map_keys/map_values for manual equality","Test equality predicates after schema changes"],"tags":["presto","map","equality","not-supported"],"backgroundTag":"unsupported-map-key-type","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"}