{"record":{"id":"7b749613cad18e63","repo":"prestodb/presto","slug":"position-is-not-valid-7b7496","errorCode":null,"errorMessage":"position is not valid","messagePattern":"position is not valid","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-common/src/main/java/com/facebook/presto/common/block/AbstractMapBlock.java","lineNumber":424,"sourceCode":"    }\n\n    @Override\n    public boolean isNull(int position)\n    {\n        checkReadablePosition(position);\n        boolean[] mapIsNull = getMapIsNull();\n        return mapIsNull != null && mapIsNull[position + getOffsetBase()];\n    }\n\n    public boolean isHashTablesPresent()\n    {\n        return getHashTables().get() != null;\n    }\n\n    private void checkReadablePosition(int position)\n    {\n        if (position < 0 || position >= getPositionCount()) {\n            throw new IllegalArgumentException(\"position is not valid\");\n        }\n    }\n\n    public static class HashTables\n    {\n        private static final int INSTANCE_SIZE = ClassLayout.parseClass(HashTables.class).instanceSize();\n\n        // Hash to location in map. Writes to the field by MapBlock is protected by \"HashTables\" monitor in MapBlock.\n        // MapBlockBuilder instances have their dedicated hashTables instances, so the write accesses to the hashTables\n        // fields do not need to be synchronized in that class.\n        @Nullable\n        private volatile int[] hashTables;\n\n        // The number of hash tables. Each map row corresponds to one hash table if it's built.\n        private int expectedHashTableCount;\n\n        HashTables(Optional<int[]> hashTables, int expectedHashTableCount)\n        {","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-common/src/main/java/com/facebook/presto/common/block/AbstractMapBlock.java#L406-L442","documentation":"AbstractMapBlock's checkReadablePosition rejects map block accesses outside [0, positionCount). Its constructor-less throw site means any isNull/read on a stale or wrongly offset map position triggers this argument guard.","triggerScenarios":"Thrown at presto-common/src/main/java/com/facebook/presto/common/block/AbstractMapBlock.java:424 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate position against getPositionCount() before access","Fix the caller's iteration bounds or offset arithmetic"],"exampleFix":null,"handlingStrategy":"validation","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"}